-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
87 lines (81 loc) · 2.21 KB
/
Copy pathdocker-compose.yml
File metadata and controls
87 lines (81 loc) · 2.21 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
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
name: smart-route
services:
api-v1:
build:
context: ./services/api-v1
container_name: smart-route-api-v1
restart: unless-stopped
networks:
- smart-route-net
healthcheck:
test: ["CMD", "python", "-c", "import urllib.request; urllib.request.urlopen('http://127.0.0.1:8000/health')"]
interval: 10s
timeout: 5s
retries: 3
start_period: 5s
api-v2:
build:
context: ./services/api-v2
container_name: smart-route-api-v2
restart: unless-stopped
environment:
V2_FAIL_RATE: ${V2_FAIL_RATE:-0.0}
networks:
- smart-route-net
healthcheck:
test: ["CMD", "python", "-c", "import urllib.request; urllib.request.urlopen('http://127.0.0.1:8000/health')"]
interval: 10s
timeout: 5s
retries: 3
start_period: 5s
nginx:
build:
context: ./nginx
container_name: smart-route-nginx
restart: unless-stopped
ports:
- "8080:80"
volumes:
- nginx-config:/etc/nginx/conf.d
depends_on:
api-v1:
condition: service_healthy
api-v2:
condition: service_healthy
networks:
- smart-route-net
healthcheck:
test: ["CMD", "wget", "-qO-", "http://127.0.0.1/nginx-health"]
interval: 10s
timeout: 5s
retries: 3
start_period: 5s
watchdog-agent:
build:
context: ./watchdog-agent
container_name: smart-route-watchdog
restart: unless-stopped
environment:
V2_CONTAINER_NAME: smart-route-api-v2
NGINX_CONTAINER_NAME: smart-route-nginx
NGINX_CONFIG_PATH: /nginx-config/default.conf
DISCORD_WEBHOOK_URL: ${DISCORD_WEBHOOK_URL:-}
ERROR_THRESHOLD: ${ERROR_THRESHOLD:-5}
ERROR_WINDOW_SECONDS: ${ERROR_WINDOW_SECONDS:-60}
POLL_INTERVAL_SECONDS: ${POLL_INTERVAL_SECONDS:-1}
volumes:
- /var/run/docker.sock:/var/run/docker.sock
- nginx-config:/nginx-config
depends_on:
nginx:
condition: service_healthy
api-v2:
condition: service_healthy
networks:
- smart-route-net
networks:
smart-route-net:
driver: bridge
volumes:
nginx-config:
driver: local