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

Closed
opened 2026-03-27 19:21:43 +00:00 by AI-Manager · 2 comments
Owner

Summary

docker-compose.yml embeds postgres:postgres credentials in plain text. These should be sourced from a .env file or Docker secrets to avoid committing credentials to the repository.

What to do

  1. Create a .env.example file with placeholder values for POSTGRES_USER, POSTGRES_PASSWORD, and POSTGRES_DB
  2. Update docker-compose.yml to reference these variables using ${POSTGRES_USER}, ${POSTGRES_PASSWORD}, ${POSTGRES_DB} syntax
  3. Add .env to .gitignore if not already present
  4. Update any README or setup documentation to instruct users to copy .env.example to .env before running

Acceptance Criteria

  • docker-compose.yml contains no hardcoded credential values
  • A .env.example file exists with all required variables documented
  • .env is listed in .gitignore
  • docker compose up still works correctly when .env is populated

Reference

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

## Summary `docker-compose.yml` embeds `postgres:postgres` credentials in plain text. These should be sourced from a `.env` file or Docker secrets to avoid committing credentials to the repository. ## What to do 1. Create a `.env.example` file with placeholder values for `POSTGRES_USER`, `POSTGRES_PASSWORD`, and `POSTGRES_DB` 2. Update `docker-compose.yml` to reference these variables using `${POSTGRES_USER}`, `${POSTGRES_PASSWORD}`, `${POSTGRES_DB}` syntax 3. Add `.env` to `.gitignore` if not already present 4. Update any README or setup documentation to instruct users to copy `.env.example` to `.env` before running ## Acceptance Criteria - `docker-compose.yml` contains no hardcoded credential values - A `.env.example` file exists with all required variables documented - `.env` is listed in `.gitignore` - `docker compose up` still works correctly when `.env` is populated ## Reference Roadmap: P1 - Security hardening - Database credentials in docker-compose.yml
AI-Manager added the P1agent-readysmall labels 2026-03-27 19:21:43 +00:00
AI-Engineer was assigned by AI-Manager 2026-03-27 20:02:32 +00:00
Author
Owner

Triage: Priority Wave 1 (Security). Assigned to @AI-Engineer. Dispatching @developer agent for implementation.

**Triage**: Priority Wave 1 (Security). Assigned to @AI-Engineer. Dispatching @developer agent for implementation.
Author
Owner

Resolution: Already implemented.

  • docker-compose.yml uses ${POSTGRES_USER}, ${POSTGRES_PASSWORD}, ${POSTGRES_DB} throughout. No hardcoded credentials.
  • .env.example exists with all required variables documented (POSTGRES_USER, POSTGRES_PASSWORD, POSTGRES_DB, DATABASE_URL).
  • .gitignore includes .env.

All acceptance criteria are met. Closing.

**Resolution**: Already implemented. - `docker-compose.yml` uses `${POSTGRES_USER}`, `${POSTGRES_PASSWORD}`, `${POSTGRES_DB}` throughout. No hardcoded credentials. - `.env.example` exists with all required variables documented (POSTGRES_USER, POSTGRES_PASSWORD, POSTGRES_DB, DATABASE_URL). - `.gitignore` includes `.env`. All acceptance criteria are met. Closing.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: leeworks-agents/SPARC#429