Skip to content
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

Docker compose SVIX_DB_DSN does not use POSTGRES_USER #788

Open
jtagcat opened this issue Feb 11, 2024 · 0 comments
Open

Docker compose SVIX_DB_DSN does not use POSTGRES_USER #788

jtagcat opened this issue Feb 11, 2024 · 0 comments

Comments

@jtagcat
Copy link

jtagcat commented Feb 11, 2024

Compose file defines: SVIX_DB_DSN: postgresql://${POSTGRES_USER}:${POSTGRES_PASSWORD}@db

# docker compose up -d
WARN[0000] The "POSTGRES_USER" variable is not set. Defaulting to a blank string. 
WARN[0000] The "POSTGRES_PASSWORD" variable is not set. Defaulting to a blank string.

Environment variables to be used within compose are read from the shell's environment or .env file in the same directory. env_file differs, it sets ENV from file, and cannot be referenced.

This issue has been annoying in other projects for me. One possible solution would be to move the constructor to .env.xyz file:

POSTGRES_USER=lotus
POSTGRES_PASSWORD=lotus
POSTGRES_DB=lotus
SVIX_DB_DSN=postgresql://${POSTGRES_USER}:${POSTGRES_PASSWORD}@db
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants
@jtagcat and others