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

Show how to utilize the provided .env file in the docker-compose file #50712

Merged
merged 5 commits into from
Jun 14, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 6 additions & 0 deletions examples/with-docker-compose/docker-compose.dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,15 @@ services:
build:
context: ./next-app
dockerfile: dev.Dockerfile

# Set environment variables directly in the docker-compose file
environment:
ENV_VARIABLE: ${ENV_VARIABLE}
NEXT_PUBLIC_ENV_VARIABLE: ${NEXT_PUBLIC_ENV_VARIABLE}

# Set envrionment variables based on the .env file
env_file:
- .env
volumes:
- ./next-app/src:/app/src
- ./next-app/public:/app/public
Expand Down