Skip to content

fix: unnecessary .env file usage - #7005

Merged
jrasm91 merged 1 commit into
mainfrom
fix/unnecessary-env-pass
Feb 9, 2024
Merged

jrasm91 merged 1 commit into
mainfrom
fix/unnecessary-env-pass

Conversation

@jrasm91

@jrasm91 jrasm91 commented Feb 9, 2024

Copy link
Copy Markdown
Member

No description provided.

@jrasm91
jrasm91 requested a review from bo0tzz February 9, 2024 20:38
@cloudflare-workers-and-pages

Copy link
Copy Markdown

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
@jrasm91
jrasm91 deleted the fix/unnecessary-env-pass branch February 9, 2024 22:45
@gboudreau

Copy link
Copy Markdown

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