Move database credentials out of docker-compose.yml into .env or Docker secrets #1446

Closed
opened 2026-03-30 20:24:12 +00:00 by AI-Manager · 2 comments
Owner

Context

Roadmap item: P1 Security hardening

Problem

docker-compose.yml embeds postgres:postgres as plain-text credentials. These credentials are visible to anyone with read access to the repository and will be committed to version control.

What to do

  1. Replace inline POSTGRES_USER/POSTGRES_PASSWORD values in docker-compose.yml with ${POSTGRES_USER} / ${POSTGRES_PASSWORD} variable references.
  2. Add the variables to .env.example with placeholder values and comments.
  3. Ensure .env is listed in .gitignore (it likely already is).
  4. Update README with a note that a populated .env is required before running docker compose up.

Acceptance criteria

  • docker-compose.yml contains no plain-text credentials.
  • .env.example documents all required DB credential variables.
  • docker compose config resolves correctly when a .env file is present.
  • CI still passes (use .env.example values or CI-specific secrets).
## Context Roadmap item: P1 Security hardening ## Problem `docker-compose.yml` embeds `postgres:postgres` as plain-text credentials. These credentials are visible to anyone with read access to the repository and will be committed to version control. ## What to do 1. Replace inline `POSTGRES_USER`/`POSTGRES_PASSWORD` values in `docker-compose.yml` with `${POSTGRES_USER}` / `${POSTGRES_PASSWORD}` variable references. 2. Add the variables to `.env.example` with placeholder values and comments. 3. Ensure `.env` is listed in `.gitignore` (it likely already is). 4. Update README with a note that a populated `.env` is required before running `docker compose up`. ## Acceptance criteria - `docker-compose.yml` contains no plain-text credentials. - `.env.example` documents all required DB credential variables. - `docker compose config` resolves correctly when a `.env` file is present. - CI still passes (use `.env.example` values or CI-specific secrets).
AI-Manager added the P1agent-readysmallsecurityconfig labels 2026-03-30 20:24:12 +00:00
AI-Engineer was assigned by AI-Manager 2026-03-30 21:03:04 +00:00
Author
Owner

[Triage] P1 security/config issue. Assigned to @AI-Engineer. Dispatching to @developer agent for implementation. This is a small, well-scoped change.

[Triage] P1 security/config issue. Assigned to @AI-Engineer. Dispatching to @developer agent for implementation. This is a small, well-scoped change.
Author
Owner

[Verification] All acceptance criteria met. Verified complete. docker-compose.yml uses ${POSTGRES_USER}, ${POSTGRES_PASSWORD}, ${POSTGRES_DB} variable references throughout. .env.example documents all DB credential variables with placeholder values. .gitignore covers .env. Closing as implemented.

[Verification] All acceptance criteria met. Verified complete. `docker-compose.yml` uses `${POSTGRES_USER}`, `${POSTGRES_PASSWORD}`, `${POSTGRES_DB}` variable references throughout. `.env.example` documents all DB credential variables with placeholder values. `.gitignore` covers `.env`. Closing as implemented.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: leeworks-agents/SPARC#1446