♻️ refactor(docker): read compose project name from .env, rename prod file#67
Conversation
…ml -> docker-compose-prod.yml & delete container_name from postgres service
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
PR ReviewSummaryThe goals of this PR (consistent naming, env-driven project names) are sound. However there are two issues to address before merging. Critical Issues1. POSTGRES_PROD_PORT exposes the production database to the host The original docker-compose.prod.yml deliberately had no ports mapping for the postgres service. In production, the database should only be reachable from within the Docker network. Adding a host port binding means that if the server firewall does not block 5432, the database is reachable from the internet. This is a security regression. Fix: Remove the ports section from the postgres service in docker-compose-prod.yml and remove POSTGRES_PROD_PORT from .env.example. Alembic and app services connect via the Docker internal network and do not need the DB port exposed. 2. Re-adding the obsolete version: '3.8' field The original prod file (without version) was already correct for Docker Compose v2+. The spec marks the top-level version field as obsolete — Compose v2 ignores it and emits a deprecation warning. Adding it back is a regression. Remove it from both docker-compose-prod.yml and docker-compose-test.yml. Suggestions3. Commit message quality Two of four commits have non-descriptive messages: 'close minor requests from review' and 'resolve conflicts'. Consider squashing or rewriting to follow the project's conventional commit style. 4. Double blank line after name: Both compose files have two blank lines between name and services. One is sufficient. Positive Notes
Overall Assessment: Request ChangesThe port exposure on the production postgres service is a security concern. Fix that and remove the obsolete version field, then this is good to merge. |
…_NAME env var
- Replace COMPOSE_PROJECT_NAME_PROD, COMPOSE_PROJECT_NAME_TEST,
and hardcoded "main" with ${APP_NAME}_prod, ${APP_NAME}_test,
${APP_NAME}_local respectively
- Standardize container_name to ${APP_NAME}_{env}_postgres across
all compose files (add to prod & test, update in local)
- Remove deprecated `version: '3.8'` from prod and test compose files
- Remove exposed postgres port in prod compose (security hardening)
Refs: #66
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Code Review — PR #67: refactor(docker): read compose project name from .env, rename prod fileThe intent is good — standardising naming and making the project name configurable. However, there are several issues that need to be resolved before this can be merged. 🔴 Critical Issues1.
|
- Replace PG_CONTAINER_NAME and dev_* credentials with APP_NAME=tma and tma_* naming in .env.example and config-example.yaml - Remove stale COMPOSE_PROJECT_NAME_TEST, COMPOSE_PROJECT_NAME_PROD, and POSTGRES_PROD_PORT vars no longer referenced by compose files Refs: #66 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Code ReviewOverall Assessment: Request Changes (minor)The refactor achieves its goals cleanly — consistent naming, env-driven config, and a good security improvement. A few items need addressing before merge. Critical Issues1. PR description is stale and inaccurateThe summary says:
But the actual change adds Suggestions for Improvement2. README does not mention
|
Summary
docker-compose.prod.yml→docker-compose-prod.ymlfor consistency withdocker-compose-test.ymlnaming conventionname: "production"withname: "${COMPOSE_PROJECT_NAME_PROD}"so the project name is read from.envCOMPOSE_PROJECT_NAME_PROD=productionto.env.examplecontainer_name: prod_postgresfrom the postgres service (lets Compose auto-generate it based on project name).github/README.mdTest plan
docker-compose.prod.ymlfilenameCloses #66
🤖 Generated with Claude Code