76 lines
1.7 KiB
YAML
76 lines
1.7 KiB
YAML
version: "3.8"
|
|
|
|
services:
|
|
ingress:
|
|
init: true
|
|
image: schmelczera/declared-ingress
|
|
depends_on:
|
|
- certbot
|
|
- frontend
|
|
deploy:
|
|
replicas: 2
|
|
resources:
|
|
limits:
|
|
cpus: "0.6"
|
|
memory: 32M
|
|
reservations:
|
|
cpus: "0.2"
|
|
memory: 32M
|
|
update_config:
|
|
parallelism: 1
|
|
failure_action: rollback
|
|
delay: 10s
|
|
monitor: 10s
|
|
restart_policy:
|
|
condition: on-failure
|
|
window: 30s
|
|
ports:
|
|
- "80:80"
|
|
- "443:443"
|
|
command: '/bin/sh -c ''while :; do sleep 6h & wait $${!}; nginx -s reload; done & nginx -g "daemon off;"'''
|
|
volumes:
|
|
- /root/data/certbot/conf:/etc/letsencrypt
|
|
- /root/data/certbot/www:/var/www/certbot
|
|
|
|
certbot:
|
|
init: true
|
|
image: certbot/certbot
|
|
deploy:
|
|
replicas: 1
|
|
resources:
|
|
limits:
|
|
cpus: "0.05"
|
|
memory: 64M
|
|
reservations:
|
|
cpus: "0.05"
|
|
memory: 64M
|
|
restart_policy:
|
|
condition: on-failure
|
|
window: 30s
|
|
entrypoint: "/bin/sh -c 'trap exit TERM; while :; do certbot renew; sleep 12h & wait $${!}; done;'"
|
|
volumes:
|
|
- /root/data/certbot/conf:/etc/letsencrypt
|
|
- /root/data/certbot/www:/var/www/certbot
|
|
|
|
frontend:
|
|
init: true
|
|
image: schmelczera/declared-frontend
|
|
ports:
|
|
- "80"
|
|
deploy:
|
|
replicas: 2
|
|
resources:
|
|
limits:
|
|
cpus: "0.1"
|
|
memory: 32M
|
|
reservations:
|
|
cpus: "0.1"
|
|
memory: 32M
|
|
update_config:
|
|
parallelism: 1
|
|
failure_action: rollback
|
|
delay: 10s
|
|
monitor: 10s
|
|
restart_policy:
|
|
condition: on-failure
|
|
window: 30s
|