You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: 16/umbraco-cms/fundamentals/setup/server-setup/running-umbraco-in-docker.md
+13-9Lines changed: 13 additions & 9 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -8,45 +8,49 @@ Docker is a platform for developing, shipping, and running applications in conta
8
8
9
9
## The Docker file system
10
10
11
-
By default, files created inside a container are written to an ephemeral, writable container layer.
11
+
By default, files created inside a container are written to an ephemeral, writable container layer.
12
12
This means that the files don't persist when the container is removed, and it's challenging to get files out of the container. Additionally, this writable layer is not suitable for performance-critical data processing.
13
13
14
14
This has implications when running Umbraco in Docker.
15
15
16
16
For more information, refer to the [Docker documentation on storage](https://docs.docker.com/engine/storage/).
17
17
18
-
### General file system consideration
18
+
### General file system consideration
19
19
20
20
In general, when working with files and Docker you work in a "push" fashion with read-only layers. When you build, you take all your files and "push" them into this read-only layer.
21
21
22
22
This means that you should avoid making files on the fly, and instead rely on building your image.
23
23
24
-
In an Umbraco context, this means you should not create or edit template, script or stylesheet files via the backoffice. These should be deployed as part of your web application and not managed via Umbraco.
24
+
In an Umbraco context, this means you should not create or edit template, script or stylesheet files via the backoffice. These should be deployed as part of your web application and not managed via Umbraco.
25
25
26
26
Similarly, you shouldn't use InMemory modelsbuilder, since that also relies on creating files on the disk. While this is not a hard requirement, it doesn't provide any value unless you are live editing your site.
27
27
28
28
Instead, configure models builder to use "source code" mode in development, and "none" in production, as [described when using runtime modes](https://docs.umbraco.com/umbraco-cms/fundamentals/setup/server-setup/runtime-modes).
29
29
30
-
31
30
### Logs
32
31
33
-
Umbraco writes logs to the `/umbraco/Logs/` directory. Due to the performance implications of writing to a writable layer,
34
-
and the limited size, it is recommended to mount a volume to this directory.
32
+
Umbraco writes logs to the `/umbraco/Logs/` directory. Due to the performance implications of writing to a writable layer, and the limited size, it is recommended to mount a volume to this directory.
33
+
34
+
You may prefer to avoid writing to disk for logs when hosting in containers. If so, you can disable this default behavior and register a custom Serilog sink to alternative storage, such as Azure Table storage.
35
+
36
+
You can also provide an alternative implementation of a common abstraction for the log viewer. In this way you can read logs from the location where you have configured them to be written.
37
+
38
+
For more on this please read the article on Umbraco's [log viewer](../../backoffice/logviewer.md).
35
39
36
40
### Data
37
41
38
42
The `/umbraco/Data/` directory is used to store temporary files, such as file uploads. Considering the limitations of the writable layer, you should also mount a volume to this directory.
39
43
40
44
### Media
41
45
42
-
It's recommended to not store media in the writable layer. This is for similar performance reasons as logs,
43
-
but also for practical hosting reasons. You likely want to persist media files between containers.
46
+
It's recommended to not store media in the writable layer. This is for similar performance reasons as logs,
47
+
but also for practical hosting reasons. You likely want to persist media files between containers.
44
48
45
49
One solution is to use bind mounts. The ideal setup, though, is to store the media and ImageSharp cache externally. For more information, refer to the [Azure Blob Storage documentation](https://docs.umbraco.com/umbraco-cms/extending/filesystemproviders/azure-blob-storage).
46
50
47
51
### Required files
48
52
49
-
Your solution may require some specific files to run, such as license files. You will need to pass these files into the container at build time, or mount them externally.
53
+
Your solution may require some specific files to run, such as license files. You will need to pass these files into the container at build time, or mount them externally.
0 commit comments