Implement docker secrets as best-practice #4423
Closed
DennisGaida
started this conversation in
Feature Request
Replies: 1 comment 2 replies
-
There's a related discussion for this: #3773 I think supporting this makes sense, happy to consider a PR for it |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
First Check
Please provide a concise description of the problem that would be addressed by this feature.
I almost wanted to add this as a bug, but it isn't since there isn't really "a standard", but there is precedence how pretty much all other docker projects are doing secrets and they are not doing it like #3656.
We currently have to set a docker secret with the exact key e.g.
POSTGRES_PASSWORD
(see https://docs.mealie.io/documentation/getting-started/installation/backend-config/#docker-secrets). This completely fails when I have multiple docker containers in a stack that each want a differentPOSTGRES_PASSWORD
.One solution could be to prefix the environment variable like
MEALIE_POSTGRES_PASSWORD
, but ultimately the best practice is to have<...>_FILE
or<...>__FILE
environment variables just referencing the path to the secret (this way we could also get rid of the hardcoded/run/secrets
mealie/mealie/core/settings/settings.py
Line 49 in d05f27d
Please provide a concise description of the feature that would resolve your issue.
Docker secrets should be like so:
The settings code could just check for the environment variables and *if a
_FILE
variable exists, and if it exists just read the value from that file specified in the path.Please consider and list out some caveats or tradeoffs made in your design decision
A tradeoff is that you need to specify the full path to your secret in the
<...>_FILE
environment variable instead of just the secret name, but it makes it more versatile and it is how everyone else is doing it.Additional Information
Beta Was this translation helpful? Give feedback.
All reactions