-
Notifications
You must be signed in to change notification settings - Fork 318
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add support for Docker Compose secrets #429
Comments
All of these environment variables are ones that are supported directly by Ghost, not ones we've created/invented ourselves, so I'd be extremely hesitant to codify them (or any additional behavior for them) in our scripts. 🤔 Does Ghost not have a built-in mechanism for reading these values from files instead? I guess from their perspective it's perhaps strange to want to read these variable values from files and not simply use a configuration file instead, but this means of secrets-via-files is not entirely unique to the container ecosystem: https://systemd.io/CREDENTIALS/ Duplicate of #125 |
The script simply looks for specified variables with MySQL uses this exact script to do the same thing: https://github.com/docker-library/mysql/blob/df3a5c483a5e8c3c4d1eae61678fa5372c403bf0/8.0/docker-entrypoint.sh#L28 Ghost is a Node.js app using a single JSON file ( If you feel strongly about not incorporating this, feel free to close the PR and I'll just keep on using my version. I simply wanted to help others avoid setting secrets on the command line where it's risky. |
Ghost doesn't currently have support for file-based Docker Compose secrets, which makes it harder to give Ghost its own user name/password, store the secret in a file separate from the Compose file etc.
MySQL has support for this in their docker container, and I have used their
docker-entrypoint.sh
file to add support for file-based secrets to the following config entries:database__connection__host
database__connection__user
database__connection__password
database__connection__database
mail__auth__user
mail__auth__pass
I'm currently running the container with my own
docker-entrypoint.sh
which has these changes, but I figure it would be useful to upstream this for others who may run into the same problem.I have a PR ready, which I will link to the issue shortly.
The text was updated successfully, but these errors were encountered: