SSE-Lab/dockerized/simple_site/docker-compose.yaml

67 lines
1.1 KiB
YAML

version: '3'
networks:
cluster:
driver: bridge
services:
# 3 versions of the same app responding to host's 3001-3
app1:
build: .
environment:
- APP_NAME=App1
ports:
- "3001:3000"
networks:
- cluster
app2:
build: .
environment:
- APP_NAME=App2
ports:
- "3002:3000"
networks:
- cluster
app3:
build: .
environment:
- APP_NAME=App3
ports:
- "3003:3000"
networks:
- cluster
# --- NGINX ---
nginx:
image: nginx:latest
ports:
- '80:80'
volumes:
- ./nginx/config.con:/etc/nginx/nginx.con:ro
deploy:
replicas: 4
update_config:
parallelism: 2
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
healthcheck:
test: ["CMD", "service", "nginx", "status"]
networks:
- cluster