Docker Compose Options
loging
Reduce container size of logs (support compose & swarm)
dns
commnds
Fire commands inside container
YAML
command: >
/bin/bash -c "
while ! nc -z cloud-config 8888; do
echo \"Cloud-Config not available yet. Sleeping 5 sec.\";
sleep 5;
done;
echo \"Connected to Cloud-Config!\";
/usr/local/tomcat/bin/catalina.sh run
"
ports
extra_hosts
Labels
Container Name
Give container a name (support compose & !swarm)
Zero Downtime Deploy
YAML
healthcheck:
test: ["CMD", "curl", "127.0.0.1:8080/api/something"]
deploy:
replicas: 1
resources:
reservations:
memory: 768M
limits:
memory: 2048M
update_config:
order: start-first
failure_action: rollback
delay: 10s
rollback_config:
parallelism: 0
order: stop-first
restart_policy:
condition: any
delay: 5s
max_attempts: 3
window: 120s