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: 15/umbraco-cms/fundamentals/setup/server-setup/running-umbraco-in-docker.md
+54-3Lines changed: 54 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,6 +1,6 @@
1
1
# Running Umbraco in Docker
2
2
3
-
Exactly how you chose to compose your Dockerfile depends on your needs, and your project, so this section is not intended as a guide,
3
+
Exactly how you choose to compose your Dockerfile depends on your needs, and your project, so this section is not intended as a guide,
4
4
but as a general overview of what to be aware of when hosting in Docker.
5
5
6
6
## What is Docker
@@ -12,21 +12,25 @@ for more information, [refer to the official Docker documentation](https://docs.
12
12
13
13
By default, all files created inside a container is written to a ephemeral writable container layer.
14
14
This means that the files don't persist when the container is removed, and it's difficult to get files out of the container. Additionally, this writable layer is not suitable for performance-critical data processing.
15
-
This has several implications when running Umbraco in Docker. For more information refer to the [Docker documentation on storage](https://docs.docker.com/engine/storage/).
15
+
This has several implications when running Umbraco in Docker. For more information, refer to the [Docker documentation on storage](https://docs.docker.com/engine/storage/).
16
16
17
17
### General file system consideration
18
18
19
19
In general, when working with files and Dockcer you work in a "push" fashion with the read-only layers, that is when you build you take all your files and "push" them into the read-only layer.
20
20
This means that you should avoid making files on the fly, and instead rely on building your image, this means that you should not create or edit template files on the fly, the same goes for script and style files.
21
21
22
-
Similarly, you shouldn't use InMemory modelsbuilder, since that also relies on creating files on the disk, instead you should use source code in development, and none in production, as [described when using runtime modes](https://docs.umbraco.com/umbraco-cms/fundamentals/setup/server-setup/runtime-modes).
22
+
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 simply doesn't provide any value if not live editing your site, instead you should use source code in development, and none in production, as [described when using runtime modes](https://docs.umbraco.com/umbraco-cms/fundamentals/setup/server-setup/runtime-modes).
23
23
24
24
25
25
### Logs
26
26
27
27
Umbraco writes logs to the `/umbraco/Logs/` directory, due to the performance implications of writing to a writable layer,
28
28
and the limited size of the writable layer, it is recommended to mount a volume to this directory.
29
29
30
+
### Data
31
+
32
+
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.
33
+
30
34
### Media
31
35
32
36
Similarly to logs, it's recommended to not store media in the writable layer, both for performance reasons,
@@ -35,9 +39,56 @@ but also for practical development reason, you likely want to persist media file
35
39
One possible solution here is to again use bind mounts, however the ideal solution is store the media and ImageSharp cache externally,
36
40
for more information on this, refer to the [Azure Blob Storage documentation](https://docs.umbraco.com/umbraco-cms/extending/filesystemproviders/azure-blob-storage).
37
41
42
+
### Required files
43
+
44
+
If your solution requires some files to run, for instance license files, you need to pass these files into the container at build time, or mount them externally.
38
45
39
46
## HTTPS
40
47
41
48
When running in websites in Docker, it's common to use do so behind a reverse proxy, or load balancers.
42
49
In these scenarios you're likely to handle SSL termination at the reverse proxy, this means that Umbraco will not be aware of the SSL termination, and will likely complain about not using HTTPS.
43
50
51
+
Umbraco checks for HTTPS in two locations:
52
+
53
+
1. The `HstsCheck` health check - This will result in a failed healthcheck.
54
+
2. The `UseHttpsValidator` - This will result in a build error, if Production runtime mode is used.
55
+
56
+
To avoid these checks failing, you can remove them in your project.
57
+
58
+
### Health Check
59
+
60
+
The health check must be removed via configuration, either through the `appsettings.json`, environment variables, or similar, for more information see the [Health Check documentation](../../../reference/configuration/healthchecks.md).
61
+
62
+
The `HstsCheck` key is `E2048C48-21C5-4BE1-A80B-8062162DF124` so the appsettings will look something like:
63
+
64
+
```json
65
+
"Umbraco": {
66
+
"CMS": {
67
+
"HealthChecks" : {
68
+
"DisabledChecks": [
69
+
{
70
+
"Id": "E2048C48-21C5-4BE1-A80B-8062162DF124"
71
+
}
72
+
]
73
+
},
74
+
{...}
75
+
```
76
+
### Runtime mode validator
77
+
78
+
The `UseHttpsValidator` must be removed through code, for more information see the [Runtime mode documentation](runtime-modes.md).
79
+
80
+
The code to remove the validator can look something like:
81
+
82
+
```C#
83
+
using Umbraco.Cms.Core.Composing;
84
+
using Umbraco.Cms.Infrastructure.Runtime.RuntimeModeValidators;
0 commit comments