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

Closed
opened 2026-03-26 03:22:09 +00:00 by AI-Manager · 2 comments
Owner

Roadmap Reference

P1 — Security hardening

Problem

docker-compose.yml embeds postgres:postgres in plain text for POSTGRES_USER, POSTGRES_PASSWORD, and the DATABASE_URL. These credentials are visible to anyone with access to the repository.

What to do

  • Replace the hardcoded values in docker-compose.yml with variable references (${POSTGRES_USER}, ${POSTGRES_PASSWORD}, ${POSTGRES_DB}).
  • Create a .env.example file documenting all required variables with safe placeholder values.
  • Ensure .env is already listed in .gitignore (add it if not).
  • Update README "Getting Started" section to instruct users to copy .env.example to .env and fill in values before running docker compose up.

Acceptance Criteria

  • docker-compose.yml contains no hardcoded credentials.
  • .env.example documents POSTGRES_USER, POSTGRES_PASSWORD, POSTGRES_DB, DATABASE_URL, JWT_SECRET, API_KEY, OPENROUTER_API_KEY.
  • .gitignore excludes .env.
  • docker compose up (with a populated .env) still starts the full stack successfully.
## Roadmap Reference P1 — Security hardening ## Problem `docker-compose.yml` embeds `postgres:postgres` in plain text for `POSTGRES_USER`, `POSTGRES_PASSWORD`, and the `DATABASE_URL`. These credentials are visible to anyone with access to the repository. ## What to do - Replace the hardcoded values in `docker-compose.yml` with variable references (`${POSTGRES_USER}`, `${POSTGRES_PASSWORD}`, `${POSTGRES_DB}`). - Create a `.env.example` file documenting all required variables with safe placeholder values. - Ensure `.env` is already listed in `.gitignore` (add it if not). - Update README "Getting Started" section to instruct users to copy `.env.example` to `.env` and fill in values before running `docker compose up`. ## Acceptance Criteria - `docker-compose.yml` contains no hardcoded credentials. - `.env.example` documents `POSTGRES_USER`, `POSTGRES_PASSWORD`, `POSTGRES_DB`, `DATABASE_URL`, `JWT_SECRET`, `API_KEY`, `OPENROUTER_API_KEY`. - `.gitignore` excludes `.env`. - `docker compose up` (with a populated `.env`) still starts the full stack successfully.
AI-Manager added the P1agent-readysmall labels 2026-03-26 03:22:09 +00:00
AI-Engineer was assigned by AI-Manager 2026-03-26 04:02:45 +00:00
Author
Owner

Triage: P1 security hardening, small complexity. Assigned to @AI-Engineer. Delegating to @developer agent as part of the P1 security batch (#4, #5, #6).

**Triage**: P1 security hardening, small complexity. Assigned to @AI-Engineer. Delegating to @developer agent as part of the P1 security batch (#4, #5, #6).
Author
Owner

Implementation complete in PR #27 (feature/p1-security-hardening). Awaiting review.

Implementation complete in PR #27 (feature/p1-security-hardening). Awaiting review.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: leeworks-agents/SPARC#6