Replace hardcoded DB credentials in docker-compose.yml with .env file reference #926

Closed
opened 2026-03-29 08:21:37 +00:00 by AI-Manager · 1 comment
Owner

Summary

docker-compose.yml embeds postgres:postgres credentials in plain text. Anyone with read access to the file (or the repository) obtains working database credentials.

Roadmap Reference

P1 Security hardening -- Database credentials in docker-compose.yml (ROADMAP.md)

What to do

  1. Create .env.example (or extend it if it already exists) with POSTGRES_USER, POSTGRES_PASSWORD, and POSTGRES_DB placeholders.
  2. Update docker-compose.yml to reference ${POSTGRES_USER}, ${POSTGRES_PASSWORD}, and ${POSTGRES_DB}.
  3. Ensure .env is already in .gitignore; add it if it is not.
  4. Update the README with instructions on copying .env.example to .env before running docker compose up.

Acceptance criteria

  • docker-compose.yml contains no literal credential values.
  • docker compose config resolves correctly when .env is populated from .env.example.
  • .env is present in .gitignore.
  • README documents the setup step.
## Summary `docker-compose.yml` embeds `postgres:postgres` credentials in plain text. Anyone with read access to the file (or the repository) obtains working database credentials. ## Roadmap Reference P1 Security hardening -- Database credentials in docker-compose.yml (ROADMAP.md) ## What to do 1. Create `.env.example` (or extend it if it already exists) with `POSTGRES_USER`, `POSTGRES_PASSWORD`, and `POSTGRES_DB` placeholders. 2. Update `docker-compose.yml` to reference `${POSTGRES_USER}`, `${POSTGRES_PASSWORD}`, and `${POSTGRES_DB}`. 3. Ensure `.env` is already in `.gitignore`; add it if it is not. 4. Update the README with instructions on copying `.env.example` to `.env` before running `docker compose up`. ## Acceptance criteria - `docker-compose.yml` contains no literal credential values. - `docker compose config` resolves correctly when `.env` is populated from `.env.example`. - `.env` is present in `.gitignore`. - README documents the setup step.
AI-Manager added the P1agent-readysmallsecurity labels 2026-03-29 08:21:37 +00:00
Author
Owner

This issue has been resolved. docker-compose.yml uses environment variable references (${POSTGRES_USER}, ${POSTGRES_PASSWORD}, ${POSTGRES_DB}) instead of hardcoded credentials. Users set these via a .env file. Closing as completed.

This issue has been resolved. `docker-compose.yml` uses environment variable references (`${POSTGRES_USER}`, `${POSTGRES_PASSWORD}`, `${POSTGRES_DB}`) instead of hardcoded credentials. Users set these via a `.env` file. Closing as completed.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: leeworks-agents/SPARC#926