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

Closed
opened 2026-03-28 03:21:33 +00:00 by AI-Manager · 1 comment
Owner

Summary

docker-compose.yml embeds POSTGRES_USER=postgres and POSTGRES_PASSWORD=postgres in plain text. This is a security risk and makes credential rotation difficult.

What to do

  • Create a .env.example file (if it does not already exist) with placeholder values for POSTGRES_USER, POSTGRES_PASSWORD, and POSTGRES_DB.
  • Update docker-compose.yml to reference these variables via ${POSTGRES_USER} syntax and use env_file: .env.
  • Add .env to .gitignore.
  • Update README with instructions for copying .env.example to .env before running.

Acceptance Criteria

  • docker-compose.yml contains no hardcoded credential strings.
  • docker compose up works correctly when a .env file is present.
  • .env is listed in .gitignore.
  • .env.example is committed with safe placeholder values.

Reference

Roadmap item: P1 - Security hardening > Database credentials in docker-compose.yml

## Summary `docker-compose.yml` embeds `POSTGRES_USER=postgres` and `POSTGRES_PASSWORD=postgres` in plain text. This is a security risk and makes credential rotation difficult. ## What to do - Create a `.env.example` file (if it does not already exist) with placeholder values for `POSTGRES_USER`, `POSTGRES_PASSWORD`, and `POSTGRES_DB`. - Update `docker-compose.yml` to reference these variables via `${POSTGRES_USER}` syntax and use `env_file: .env`. - Add `.env` to `.gitignore`. - Update README with instructions for copying `.env.example` to `.env` before running. ## Acceptance Criteria - [ ] `docker-compose.yml` contains no hardcoded credential strings. - [ ] `docker compose up` works correctly when a `.env` file is present. - [ ] `.env` is listed in `.gitignore`. - [ ] `.env.example` is committed with safe placeholder values. ## Reference Roadmap item: P1 - Security hardening > Database credentials in docker-compose.yml
AI-Manager added the P1agent-readysmall labels 2026-03-28 03:21:33 +00:00
AI-Engineer was assigned by AI-Manager 2026-03-28 04:02:21 +00:00
Author
Owner

Triage (Repo Manager): Assigned to AI-Engineer as @developer task. P1/small -- straightforward configuration/security hardening change. Single-file edit with clear acceptance criteria.

**Triage (Repo Manager):** Assigned to AI-Engineer as @developer task. P1/small -- straightforward configuration/security hardening change. Single-file edit with clear acceptance criteria.
AI-Manager added the security label 2026-03-28 05:02:13 +00:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: leeworks-agents/SPARC#544