-
-
Notifications
You must be signed in to change notification settings - Fork 31
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 postgres docker-compose file #308
Add postgres docker-compose file #308
Conversation
Restructure the existing sqlite docker-compose yaml file and add an additional docker-compose file for postgres. Also update the README accordingly.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I appreciate the contribution; should we not use an env_file
instead of expecting environment variables?
The env file would need to be loaded by the calling sh/bash then. The alternative would be to not use environment variables and setting the strings in the compose files directly. But then we would need to copy/paste strings (once for the DSN string and once for the DB container's env and/or health check). BTW, I will check the formatting issues asap! |
I'm not sure what you mean by "build time"; I was referring to this feature in docker compose: https://docker.qubitpi.org/compose/environment-variables/set-environment-variables/#use-the-env_file-attribute I use this for keeping secrets away from the compose files, and keeping the compose files in git. |
Sorry, I wasn't aware that the go module for postgres can handle environment variables at runtime. The difference: If setting the environment variable in bash, the variables would already be replaced at buildtime (when running I quickly tested the runtime approach and it seems to be handled correctly by go. |
Restructure the existing sqlite docker-compose yaml file and add an additional docker-compose file for postgres.
Also update the README accordingly.