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

fix: unnecessary .env file usage #7005

Merged
merged 1 commit into from
Feb 9, 2024
Merged

fix: unnecessary .env file usage #7005

merged 1 commit into from
Feb 9, 2024

Conversation

jrasm91
Copy link
Contributor

@jrasm91 jrasm91 commented Feb 9, 2024

No description provided.

Copy link

Deploying with  Cloudflare Pages  Cloudflare Pages

Latest commit: dfde31e
Status: ✅  Deploy successful!
Preview URL: https://dd77322a.immich.pages.dev
Branch Preview URL: https://fix-unnecessary-env-pass.immich.pages.dev

View logs

@jrasm91 jrasm91 merged commit d0b5623 into main Feb 9, 2024
25 checks passed
@jrasm91 jrasm91 deleted the fix/unnecessary-env-pass branch February 9, 2024 22:45
@gboudreau
Copy link

I was wondering why the env_file value was not needed.
The lines that follow (environment and volumes) use variables that are defined in the .env file, eg. POSTGRES_PASSWORD: ${DB_PASSWORD}, so if you remove env_file, how is docker-compose loading those values?

Answering myself: variables defined in env_file are NOT available as variables in the compose file; they are injected as environment variables when running the container. Variables available in the compose file are defined in the .env file, in the same folder as the compose.yml file.
Re-using .env as env_file makes sense, because that means Docker containers configurations will match values used by running containers.

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

Successfully merging this pull request may close these issues.

3 participants