Skip to content

refactor: read compose project name from .env instead of hardcoding, rename prod compose file #66

@itisnotyourenv

Description

@itisnotyourenv

Problem

docker-compose.prod.yml hardcodes the project name as name: "production" (line 2). This is inconsistent with how the other compose files work — docker-compose.yml and docker-compose-test.yml both read container names and other values from .env / .env.example, but the production compose file has a static project name baked in.

Additionally, the production compose file uses a dot-separated naming convention (docker-compose.prod.yml) while the test compose file uses a dash-separated convention (docker-compose-test.yml). This inconsistency makes it harder to discover and reference files.

Current behavior

  • docker-compose.prod.yml has name: "production" hardcoded on line 2
  • File naming is inconsistent: docker-compose-test.yml (dash) vs docker-compose.prod.yml (dot)

Expected behavior

  1. Rename docker-compose.prod.ymldocker-compose-prod.yml to match the existing docker-compose-test.yml naming convention
  2. Read project name from .env — add a COMPOSE_PROJECT_NAME variable (or similar) to .env / .env.example and reference it in the compose file instead of hardcoding name: "production"

Files to update

  • Rename docker-compose.prod.ymldocker-compose-prod.yml
  • Replace name: "production" with name: "${COMPOSE_PROJECT_NAME_PROD}" (or similar env var) in the renamed file
  • Add the new env var to .env.example with a sensible default (e.g., COMPOSE_PROJECT_NAME_PROD=production)
  • Update .env accordingly
  • Update all references in .github/README.md (lines 76, 87, 92)
  • Check for any other references to the old filename (justfile, CI, scripts, etc.)

Context

The docker-compose.yml and docker-compose-test.yml files already follow the pattern of reading configuration from .env. This change brings the production compose file in line with that convention, making the setup more configurable and consistent.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions