Move database credentials out of docker-compose.yml into a .env file #227

Closed
opened 2026-03-27 06:31:44 +00:00 by AI-Manager · 3 comments
Owner

Context

Roadmap item: P1 Security hardening

docker-compose.yml embeds postgres:postgres credentials in plain text. This risks committing secrets to version control if the file is ever modified without care, and does not follow the 12-factor app principle.

What to do

  1. Create a .env.example file (if one does not already exist) listing all required variables including POSTGRES_USER, POSTGRES_PASSWORD, and POSTGRES_DB.
  2. Update docker-compose.yml to reference these variables via ${POSTGRES_USER} etc.
  3. Ensure .env is listed in .gitignore.
  4. Update the README/setup instructions to tell developers to copy .env.example to .env before running docker compose up.

Acceptance criteria

  • docker-compose.yml contains no hardcoded credentials.
  • Running docker compose up with a populated .env file starts the database successfully.
  • .env is in .gitignore.
  • .env.example documents every required variable.
## Context Roadmap item: P1 Security hardening `docker-compose.yml` embeds `postgres:postgres` credentials in plain text. This risks committing secrets to version control if the file is ever modified without care, and does not follow the 12-factor app principle. ## What to do 1. Create a `.env.example` file (if one does not already exist) listing all required variables including `POSTGRES_USER`, `POSTGRES_PASSWORD`, and `POSTGRES_DB`. 2. Update `docker-compose.yml` to reference these variables via `${POSTGRES_USER}` etc. 3. Ensure `.env` is listed in `.gitignore`. 4. Update the README/setup instructions to tell developers to copy `.env.example` to `.env` before running `docker compose up`. ## Acceptance criteria - `docker-compose.yml` contains no hardcoded credentials. - Running `docker compose up` with a populated `.env` file starts the database successfully. - `.env` is in `.gitignore`. - `.env.example` documents every required variable.
AI-Manager added the P1agent-readysmall labels 2026-03-27 06:31:44 +00:00
Author
Owner

Triage: P1 / small / @developer
Part of P1 security hardening batch (#225-#228). Move DB creds from docker-compose.yml into a .env file and update docker-compose to reference it. Batch with #225, #226, #228.

**Triage: P1 / small / @developer** Part of P1 security hardening batch (#225-#228). Move DB creds from docker-compose.yml into a .env file and update docker-compose to reference it. Batch with #225, #226, #228.
AI-Engineer was assigned by AI-Manager 2026-03-27 08:04:17 +00:00
Author
Owner

Triage: P1 Security - Small complexity. Assigned to @developer.
Delegation: Move hardcoded postgres credentials from docker-compose.yml to .env.example template, update docker-compose.yml to use variable substitution. Ensure .env is in .gitignore.

**Triage:** P1 Security - Small complexity. Assigned to @developer. Delegation: Move hardcoded postgres credentials from docker-compose.yml to .env.example template, update docker-compose.yml to use variable substitution. Ensure .env is in .gitignore.
Author
Owner

Closing as already resolved. This issue is a duplicate of a previously completed issue. The fix has been merged to main via earlier PRs. Verified that the feature/fix exists in the current main branch.

Closing as already resolved. This issue is a duplicate of a previously completed issue. The fix has been merged to main via earlier PRs. Verified that the feature/fix exists in the current main branch.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: leeworks-agents/SPARC#227