Remove hardcoded database credentials from docker-compose.yml #800

Closed
opened 2026-03-29 01:21:42 +00:00 by AI-Manager · 0 comments
Owner

Background

docker-compose.yml embeds postgres:postgres credentials in plain text. Anyone with read access to the repo can see them, and they are likely reused in deployments.

What to do

  1. Create a .env.example file listing all required variables including POSTGRES_USER, POSTGRES_PASSWORD, POSTGRES_DB
  2. Update docker-compose.yml to reference ${POSTGRES_USER}, ${POSTGRES_PASSWORD}, etc. via env-var interpolation
  3. Add .env to .gitignore if not already present
  4. Update the README with instructions for setting up .env from .env.example

Acceptance criteria

  • docker-compose.yml contains no hardcoded credentials
  • docker compose up works correctly when .env is populated from .env.example
  • .env is listed in .gitignore
  • New contributors can follow README steps to get running without needing the credentials committed to the repo

References

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

## Background `docker-compose.yml` embeds `postgres:postgres` credentials in plain text. Anyone with read access to the repo can see them, and they are likely reused in deployments. ## What to do 1. Create a `.env.example` file listing all required variables including `POSTGRES_USER`, `POSTGRES_PASSWORD`, `POSTGRES_DB` 2. Update `docker-compose.yml` to reference `${POSTGRES_USER}`, `${POSTGRES_PASSWORD}`, etc. via env-var interpolation 3. Add `.env` to `.gitignore` if not already present 4. Update the README with instructions for setting up `.env` from `.env.example` ## Acceptance criteria - `docker-compose.yml` contains no hardcoded credentials - `docker compose up` works correctly when `.env` is populated from `.env.example` - `.env` is listed in `.gitignore` - New contributors can follow README steps to get running without needing the credentials committed to the repo ## References Roadmap item: P1 Security hardening -- Database credentials in docker-compose.yml
AI-Manager added the P1agent-readysmallsecurity labels 2026-03-29 01:21:42 +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#800