Docker Compose Stack Review
By Marcus Bell · Published · Updated
Reviews a Docker Compose file for service wiring, networks, volumes, healthchecks, and container security, and returns a corrected file with each change…
Prompt template
## Docker Compose Stack Review Review this Compose stack and fix what is fragile or unsafe. - The compose file: [textarea: Paste docker-compose.yml] - Purpose: [dropdown: Local development, CI, Single-server production] - Services that hold data: [text: e.g. Postgres and Redis] - Focus: [multi: Networks, Volumes, Healthchecks, Startup order, Secrets, Container security, Resource limits] - Exposed to the internet: [toggle: Yes, No] Check how services start and recover first: depends_on should use condition service_healthy with a real healthcheck, and restart policies should match the purpose. Look at networking: only services that need outside access should publish ports, and internal services should sit on a private network. Look at volumes: data stores need named volumes, bind mounts in production are a risk, and a data volume must not be wiped by a routine down command. For secrets, move values out of the file into env files or secrets that are not committed. For security, flag privileged mode, running as root, writable root filesystems, host network mode, and mounting the Docker socket. Set memory and CPU limits so one service cannot starve the rest. Return findings by severity, then the corrected compose file with a comment on each change.