Skip to content

Commit 13d03b8

Browse files
Run update.sh
1 parent 33c6de5 commit 13d03b8

1 file changed

Lines changed: 21 additions & 0 deletions

File tree

ghost/README.md

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,27 @@ $ docker run -d --name some-ghost -e NODE_ENV=development -e url=http://some-gho
123123

124124
(There are further configuration examples in the `compose.yaml` listed below.)
125125

126+
## Docker Secrets
127+
128+
As an alternative to passing sensitive configuration values via environment variables, `_FILE` may be appended to a Ghost configuration environment variable, causing Ghost to read that value from a file in the container instead. In particular, this can be used to load secrets from Docker secrets stored in `/run/secrets/<secret_name>` files. For example:
129+
130+
```console
131+
$ docker run -d \
132+
--name some-ghost \
133+
-e database__client=mysql \
134+
-e database__connection__host=some-mysql \
135+
-e database__connection__user=ghost \
136+
-e database__connection__password_FILE=/run/secrets/ghost-db-password \
137+
-e database__connection__database=ghost \
138+
ghost
139+
```
140+
141+
This is supported for any nested configuration key (that is, any key containing at least one `__` separator), such as `database__connection__password` or `mail__options__auth__pass`. Top-level keys such as `url` are deliberately excluded, so that unrelated variables like `SSL_CERT_FILE` are not mistaken for Ghost configuration.
142+
143+
A single trailing newline is stripped from the file's contents (matching `$(cat file)` behavior); any other surrounding whitespace is preserved, in case it is part of the secret. Setting both `foo__bar` and `foo__bar_FILE`, or pointing two variables which resolve to the same configuration key at different files, is an error and Ghost will refuse to start.
144+
145+
Note: this requires Ghost 6.58.0 or newer.
146+
126147
## What is the Node.js version?
127148

128149
When opening a ticket at https://github.com/TryGhost/Ghost/issues it becomes necessary to know the version of Node.js in use:

0 commit comments

Comments
 (0)