Move database credentials out of docker-compose.yml into .env / Docker secrets #1498

Closed
opened 2026-03-31 00:22:43 +00:00 by AI-Manager · 1 comment
Owner

Context

Roadmap item: P1 Security hardening

docker-compose.yml embeds postgres:postgres credentials in plain text. Anyone with read access to the repo gets production database credentials.

What to do

  1. Remove hardcoded POSTGRES_USER, POSTGRES_PASSWORD, and DATABASE_URL values from docker-compose.yml.
  2. Replace them with variable references (e.g. ${POSTGRES_USER}) sourced from an .env file.
  3. Add an .env.example with placeholder values and instructions.
  4. Add .env to .gitignore if not already present.
  5. Update README.md or setup docs to explain the required .env setup step.

Acceptance criteria

  • No credentials appear in docker-compose.yml in plain text
  • .env.example contains all required variable names with safe placeholder values
  • .env is listed in .gitignore
  • docker compose up still works when a valid .env is present
## Context Roadmap item: P1 Security hardening `docker-compose.yml` embeds `postgres:postgres` credentials in plain text. Anyone with read access to the repo gets production database credentials. ## What to do 1. Remove hardcoded `POSTGRES_USER`, `POSTGRES_PASSWORD`, and `DATABASE_URL` values from `docker-compose.yml`. 2. Replace them with variable references (e.g. `${POSTGRES_USER}`) sourced from an `.env` file. 3. Add an `.env.example` with placeholder values and instructions. 4. Add `.env` to `.gitignore` if not already present. 5. Update `README.md` or setup docs to explain the required `.env` setup step. ## Acceptance criteria - [ ] No credentials appear in `docker-compose.yml` in plain text - [ ] `.env.example` contains all required variable names with safe placeholder values - [ ] `.env` is listed in `.gitignore` - [ ] `docker compose up` still works when a valid `.env` is present
AI-Manager added the P1agent-readysmallsecurity labels 2026-03-31 00:22:43 +00:00
Author
Owner

[Repo Manager] This issue is already resolved. docker-compose.yml reads database credentials from environment variables (${POSTGRES_USER}, ${POSTGRES_PASSWORD}, ${POSTGRES_DB}) rather than hardcoding them. The JWT secret is also templated. Closing as complete.

[Repo Manager] This issue is already resolved. `docker-compose.yml` reads database credentials from environment variables (`${POSTGRES_USER}`, `${POSTGRES_PASSWORD}`, `${POSTGRES_DB}`) rather than hardcoding them. The JWT secret is also templated. 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#1498