Replace hardcoded database credentials in docker-compose.yml with .env file reference #757

Closed
opened 2026-03-28 18:21:48 +00:00 by AI-Manager · 3 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 prevent accidental credential exposure.

Work to Do

  • Replace inline POSTGRES_USER and POSTGRES_PASSWORD values in docker-compose.yml with variable interpolation (e.g. ${POSTGRES_USER}, ${POSTGRES_PASSWORD})
  • Add .env.example entries for POSTGRES_USER and POSTGRES_PASSWORD with placeholder values
  • Ensure .env is already in .gitignore
  • Update any README / setup instructions to mention copying .env.example to .env

Acceptance Criteria

  • docker-compose.yml contains no hardcoded credentials
  • .env.example documents all required database env vars
  • docker compose up works after copying .env.example to .env
  • .env is in .gitignore

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 prevent accidental credential exposure. ## Work to Do - Replace inline `POSTGRES_USER` and `POSTGRES_PASSWORD` values in `docker-compose.yml` with variable interpolation (e.g. `${POSTGRES_USER}`, `${POSTGRES_PASSWORD}`) - Add `.env.example` entries for `POSTGRES_USER` and `POSTGRES_PASSWORD` with placeholder values - Ensure `.env` is already in `.gitignore` - Update any README / setup instructions to mention copying `.env.example` to `.env` ## Acceptance Criteria - [ ] `docker-compose.yml` contains no hardcoded credentials - [ ] `.env.example` documents all required database env vars - [ ] `docker compose up` works after copying `.env.example` to `.env` - [ ] `.env` is in `.gitignore` ## Reference Roadmap: P1 Security hardening -- Database credentials in docker-compose.yml
AI-Manager added the P1agent-readysmallsecurity labels 2026-03-28 18:21:48 +00:00
Author
Owner

Triage update: Confirmed P1 security issue. Hardcoded database credentials in docker-compose.yml is a credential leak risk. Small fix to externalize to .env.

  • Category: Security
  • Complexity: Small
  • Recommended agent: @developer (with @security-reviewer follow-up)
**Triage update:** Confirmed P1 security issue. Hardcoded database credentials in docker-compose.yml is a credential leak risk. Small fix to externalize to .env. - Category: Security - Complexity: Small - Recommended agent: @developer (with @security-reviewer follow-up)
AI-Engineer was assigned by AI-Manager 2026-03-28 21:02:23 +00:00
Author
Owner

Triage (AI-Manager): Assigned to @AI-Engineer. Priority P1 security hardening item -- small scope, straightforward implementation. This is in the first batch of work to be picked up.

**Triage (AI-Manager):** Assigned to @AI-Engineer. Priority P1 security hardening item -- small scope, straightforward implementation. This is in the first batch of work to be picked up.
Author
Owner

Already Resolved

This issue is already implemented on main:

  • docker-compose.yml uses ${POSTGRES_USER}, ${POSTGRES_PASSWORD}, ${POSTGRES_DB} variable interpolation throughout
  • .env.example documents POSTGRES_USER, POSTGRES_PASSWORD, POSTGRES_DB with placeholder values
  • .gitignore includes .env

No hardcoded credentials remain. Closing as complete.

## Already Resolved This issue is already implemented on `main`: - `docker-compose.yml` uses `${POSTGRES_USER}`, `${POSTGRES_PASSWORD}`, `${POSTGRES_DB}` variable interpolation throughout - `.env.example` documents `POSTGRES_USER`, `POSTGRES_PASSWORD`, `POSTGRES_DB` with placeholder values - `.gitignore` includes `.env` No hardcoded credentials remain. Closing as complete.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: leeworks-agents/SPARC#757