-
Notifications
You must be signed in to change notification settings - Fork 59
Expand file tree
/
Copy pathdocker-compose.stack.yml
More file actions
60 lines (55 loc) · 1.4 KB
/
docker-compose.stack.yml
File metadata and controls
60 lines (55 loc) · 1.4 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
version: '3.7'
x-deploy: &base-deploy
restart_policy:
condition: on-failure
placement:
constraints:
- node.labels.aiogram_bot == true
services:
bot:
image: docker.illemius.xyz/aiogram/bot:latest
command:
- run-webhook
healthcheck:
test: ["CMD", "python", "-c", "import requests;assert requests.get('http://localhost:80/healthcheck').status_code == 200"]
start_period: 5s
environment:
RUN_MIGRATIONS: 'true'
WEBHOOK_BASE_PATH:
networks:
- default
- web
depends_on:
- redis
- postgres
deploy:
<<: *base-deploy
update_config:
parallelism: 2
delay: 10s
order: start-first
failure_action: rollback
labels:
traefik.enable: true
traefik.docker.network: web
traefik.http.routers.aiogram-bot-https.entrypoints: web-secure
traefik.http.routers.aiogram-bot-https.rule: Host(`${DOMAIN}`) && PathPrefix(`${WEBHOOK_BASE_PATH}`)
traefik.http.routers.aiogram-bot-https.service: aiogram-bot
traefik.http.routers.aiogram-bot-https.tls: true
traefik.http.services.aiogram-bot.loadbalancer.server.port: 80
redis:
networks:
- default
deploy:
<<: *base-deploy
postgres:
networks:
- default
deploy:
<<: *base-deploy
networks:
default:
driver: overlay
web:
driver: overlay
external: true