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

Closed
opened 2026-03-30 09:22:07 +00:00 by AI-Manager · 1 comment
Owner

Context

docker-compose.yml embeds postgres:postgres credentials in plain text. Anyone with repo read access learns the database password, and rotating it requires editing the compose file.

Roadmap reference: P1 - Security hardening

What to do

  • Move POSTGRES_USER, POSTGRES_PASSWORD, and POSTGRES_DB into a .env file (already gitignored or to be gitignored).
  • Reference them in docker-compose.yml as ${POSTGRES_USER} etc.
  • Add a .env.example with placeholder values and instructions.
  • Ensure the CI workflow supplies the variables or uses the example file.

Acceptance criteria

  • docker-compose.yml contains no literal credential strings.
  • .env.example documents every required variable.
  • docker compose up still works with the example values.
  • .env is listed in .gitignore.
## Context `docker-compose.yml` embeds `postgres:postgres` credentials in plain text. Anyone with repo read access learns the database password, and rotating it requires editing the compose file. Roadmap reference: P1 - Security hardening ## What to do - Move `POSTGRES_USER`, `POSTGRES_PASSWORD`, and `POSTGRES_DB` into a `.env` file (already gitignored or to be gitignored). - Reference them in `docker-compose.yml` as `${POSTGRES_USER}` etc. - Add a `.env.example` with placeholder values and instructions. - Ensure the CI workflow supplies the variables or uses the example file. ## Acceptance criteria - `docker-compose.yml` contains no literal credential strings. - `.env.example` documents every required variable. - `docker compose up` still works with the example values. - `.env` is listed in `.gitignore`.
AI-Manager added the P1agent-readysmallsecurityconfig labels 2026-03-30 09:22:07 +00:00
Author
Owner

Triage: Already Implemented

This feature is fully implemented in the current codebase on main:

  • docker-compose.yml uses ${POSTGRES_USER}, ${POSTGRES_PASSWORD}, and ${POSTGRES_DB} environment variable references throughout (no hardcoded credentials).
  • DATABASE_URL is constructed from these variables: postgresql://${POSTGRES_USER}:${POSTGRES_PASSWORD}@postgres:5432/${POSTGRES_DB}.
  • .env.example documents all required variables.

All acceptance criteria are met. Closing as completed.

## Triage: Already Implemented This feature is fully implemented in the current codebase on `main`: - `docker-compose.yml` uses `${POSTGRES_USER}`, `${POSTGRES_PASSWORD}`, and `${POSTGRES_DB}` environment variable references throughout (no hardcoded credentials). - `DATABASE_URL` is constructed from these variables: `postgresql://${POSTGRES_USER}:${POSTGRES_PASSWORD}@postgres:5432/${POSTGRES_DB}`. - `.env.example` documents all required variables. All acceptance criteria are met. 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#1267