What's the priority?
β
βββββββββββββββββββββββΌββββββββββββββββββββββ
β β β
Zero downtime? Instant rollback? Test in prod?
β β β
βΌ βΌ βΌ
βββββββββββββββ βββββββββββββββ βββββββββββββββ
β Rolling β β Blue-Green β β Canary β
β Update β β β β β
β β β 2x resourcesβ β Traffic % β
β Container β β Switch LB β β Monitor β
β by containerβ β Keep old β β Gradual β
βββββββββββββββ βββββββββββββββ βββββββββββββββ
Compose config:
deploy:
update_config:
order: start-first # For rolling updates
parallelism: 1
delay: 10s
failure_action: rollback
π§ Troubleshooting Quick Reference
Exit Codes
Code
Signal
Meaning
Common Cause
0
-
Normal exit
App finished
1
-
Application error
Bug, config error
126
-
Permission denied
chmod needed
127
-
Command not found
Missing binary
137
SIGKILL
Killed
OOM, docker kill
139
SIGSEGV
Segfault
Memory corruption
143
SIGTERM
Terminated
docker stop
Quick Diagnostics
BASH(22 lines)
Code
Loading syntax highlighter...
Common Issues
Symptom
Check
Fix
Exit 137
docker inspect --format='{{.State.OOMKilled}}'
Increase memory limit
"Connection refused"
docker network inspect
Same network? Service healthy?
"No such file"
docker diff
Check volume mounts
Slow start
Health check start_period
Increase start_period
Port conflict
lsof -i :PORT
Change host port
Permission denied
File ownership
Match UID/GID
β Production Checklist
Dockerfile
β‘ Use specific base image tag (not :latest)
β‘ Multi-stage build (small final image)
β‘ Non-root USER
β‘ HEALTHCHECK defined
β‘ .dockerignore present
β‘ No secrets in image
β‘ Minimal packages installed
Compose
β‘ depends_on with condition: service_healthy
β‘ Health checks on all services
β‘ Resource limits defined
β‘ restart: unless-stopped
β‘ Logging configured with max-size
β‘ stop_grace_period set
β‘ Environment variables with defaults/required
Security
β‘ read_only: true where possible
β‘ security_opt: no-new-privileges:true
β‘ cap_drop: ALL (add back only needed)
β‘ No privileged containers
β‘ Secrets not in environment variables
β‘ Images scanned for vulnerabilities