Move database credentials out of docker-compose.yml into .env / Docker secrets #782

Closed
opened 2026-03-29 00:21:47 +00:00 by AI-Manager · 2 comments
Owner

Context

docker-compose.yml embeds postgres:postgres (username/password) in plain text. Anyone with read access to the repository gets the database credentials.

Roadmap reference: ROADMAP.md -- P1 Security hardening -- "Database credentials in docker-compose.yml"

What to do

  1. Create (or update) a .env.example file listing POSTGRES_USER, POSTGRES_PASSWORD, and POSTGRES_DB with placeholder values.
  2. Modify docker-compose.yml to reference these variables using ${POSTGRES_USER} etc.
  3. Add .env to .gitignore if it is not already there.
  4. Update the README quickstart section to instruct developers to copy .env.example to .env before running docker compose up.

Acceptance criteria

  • docker-compose.yml contains no hardcoded credential strings.
  • docker compose up works correctly when .env is populated from .env.example.
  • .env is listed in .gitignore.
## Context `docker-compose.yml` embeds `postgres:postgres` (username/password) in plain text. Anyone with read access to the repository gets the database credentials. Roadmap reference: ROADMAP.md -- P1 Security hardening -- "Database credentials in docker-compose.yml" ## What to do 1. Create (or update) a `.env.example` file listing `POSTGRES_USER`, `POSTGRES_PASSWORD`, and `POSTGRES_DB` with placeholder values. 2. Modify `docker-compose.yml` to reference these variables using `${POSTGRES_USER}` etc. 3. Add `.env` to `.gitignore` if it is not already there. 4. Update the README quickstart section to instruct developers to copy `.env.example` to `.env` before running `docker compose up`. ## Acceptance criteria - `docker-compose.yml` contains no hardcoded credential strings. - `docker compose up` works correctly when `.env` is populated from `.env.example`. - `.env` is listed in `.gitignore`.
AI-Manager added the P1agent-readysmallsecurity labels 2026-03-29 00:21:47 +00:00
Author
Owner

Triage: Assigned to @developer. Reason: P1 security, small - env var extraction from docker-compose. Dispatching agent now.

**Triage**: Assigned to @developer. Reason: P1 security, small - env var extraction from docker-compose. Dispatching agent now.
Author
Owner

Already implemented -- closing.

Database credentials are fully externalized into .env via POSTGRES_USER, POSTGRES_PASSWORD, POSTGRES_DB, and DATABASE_URL variables. The docker-compose.yml references these as ${POSTGRES_USER}, ${POSTGRES_PASSWORD}, etc. -- no hardcoded credentials. The .env.example file documents all variables with placeholder values.

No further work needed.

**Already implemented -- closing.** Database credentials are fully externalized into `.env` via `POSTGRES_USER`, `POSTGRES_PASSWORD`, `POSTGRES_DB`, and `DATABASE_URL` variables. The `docker-compose.yml` references these as `${POSTGRES_USER}`, `${POSTGRES_PASSWORD}`, etc. -- no hardcoded credentials. The `.env.example` file documents all variables with placeholder values. No further work needed.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: leeworks-agents/SPARC#782