fix(compose): improve dev/prod startup reliability#28
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: a9a6963b13
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| POSTGRES_PASSWORD: '${POSTGRES_PASSWORD}' | ||
| POSTGRES_DB: '${POSTGRES_DB:-fastifydb}' | ||
| POSTGRES_USER: '${POSTGRES_USER:-postgres}' | ||
| POSTGRES_PASSWORD: '${POSTGRES_PASSWORD:-postgres}' |
There was a problem hiding this comment.
Align the production DB password default
When the production profile is started without POSTGRES_PASSWORD, the database is initialized with the new default postgres, but fastify-prod still connects with its own default todoapp_password (line 71). A fresh docker compose --profile prod up therefore brings up Postgres successfully but the API cannot authenticate to it; use the same fallback in both places or require the variable explicitly.
Useful? React with 👍 / 👎.
Motivation
.envvalues were missing which could prevent services from starting../redis/redis.confthat does not exist in the repository, causing startup failures.:Zmount) which reduce cross-platform compatibility.Description
APP_PORT,PROD_PORT, andDB_PORTusing${VAR:-default}to allow Compose to start when env vars are absent.dband the dev service (POSTGRES_DB,POSTGRES_USER,POSTGRES_PASSWORD) to avoid empty values breaking DB initialization../redis/redis.confbind mount so the official Redis image uses its default configuration.redis-cli pingto avoid requiring ACL username/password flags and removed the SELinux-specific:Zsuffix from the dev source mount for better portability.Testing
npm run typecheckand TypeScript type checking completed successfully.docker compose configvalidation but the Docker CLI is not available in this environment so the Compose validation could not be executed here.Codex Task