Fix duplicate environment blocks in docker-compose.prod.yml#611
Fix duplicate environment blocks in docker-compose.prod.yml#611
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Co-authored-by: jthrilly <1387940+jthrilly@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
Resolves an issue in docker-compose.prod.yml where duplicate environment keys for the fresco service caused the first block to be ignored, leading to unexpected container configuration in production deployments.
Changes:
- Removed the duplicate
environmentsection for thefrescoservice. - Consolidated environment variables into a single mapping-style
environmentblock. - Adjusted
PUBLIC_URLandUPLOADTHING_TOKENdefinitions as part of the consolidation.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| DATABASE_URL: postgresql://${POSTGRES_USER}:${POSTGRES_PASSWORD}@postgres:5432/fresco | ||
| DATABASE_URL_UNPOOLED: postgresql://${POSTGRES_USER}:${POSTGRES_PASSWORD}@postgres:5432/fresco |
There was a problem hiding this comment.
DATABASE_URL/DATABASE_URL_UNPOOLED point to the fresco database, but the postgres service is configured with POSTGRES_DB=postgres (so it will initialize a postgres database by default). This mismatch will cause connection failures on a fresh volume unless the fresco DB is created elsewhere. Align the DB name by either changing POSTGRES_DB to fresco or updating the URLs to use the same database name (ideally via a shared variable).
| PUBLIC_URL: https://mywebsite.com | ||
| UPLOADTHING_TOKEN: token |
There was a problem hiding this comment.
PUBLIC_URL and especially UPLOADTHING_TOKEN are hardcoded here while an env_file: .env is also loaded; environment values take precedence over env_file, so this will override any real values provided via .env (and encourages committing secrets). Prefer referencing variables (e.g. ${PUBLIC_URL} / ${UPLOADTHING_TOKEN}) or remove these entries and supply them via .env/secrets at deploy time.
| PUBLIC_URL: https://mywebsite.com | |
| UPLOADTHING_TOKEN: token | |
| PUBLIC_URL: ${PUBLIC_URL} | |
| UPLOADTHING_TOKEN: ${UPLOADTHING_TOKEN} |
The docker-compose.prod.yml file defined
environmenttwice for the fresco service, causing YAML to silently drop the first block's variables.Changes
environmentblocks into single definitionUPLOADTHING_TOKENvalue to prevent literal quotes in environment variableDATABASE_URL,DATABASE_URL_UNPOOLED,PUBLIC_URL,UPLOADTHING_TOKENBefore:
After:
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.