-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.yaml
86 lines (82 loc) · 1.98 KB
/
docker-compose.yaml
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
services:
db:
image: postgres:17-alpine
secrets:
- db_user
- db_passwd
environment:
POSTGRES_USER_FILE: /run/secrets/db_user
POSTGRES_PASSWORD_FILE: /run/secrets/db_passwd
POSTGRES_DB: monitor
TZ: Asia/Shanghai
LANG: zh_CN.utf-8
POSTGRES_INITDB_ARGS: "--locale-provider=icu --icu-locale=zh-CN --encoding=UTF8"
volumes:
- postgres_data:/var/lib/postgresql/data
restart: unless-stopped
healthcheck:
test:
[
"CMD-SHELL",
"pg_isready -U $(cat /run/secrets/db_user) -d $$POSTGRES_DB",
]
start_period: 1m
start_interval: 5s
interval: 10m
timeout: 30s
retries: 3
redis:
image: redis:alpine
volumes:
- redis_data:/data
restart: unless-stopped
healthcheck:
test: ["CMD-SHELL", "redis-cli ping"]
start_period: 1m
start_interval: 5s
interval: 10m
timeout: 30s
retries: 3
backend:
image: ghcr.io/saitewasreset/mission_monitor:latest
secrets:
- db_conn_url
- redis_conn_url
- access_token
volumes:
- backend_data:/instance
environment:
DATABASE_URL_FILE: /run/secrets/db_conn_url
REDIS_URL_FILE: /run/secrets/redis_conn_url
ACCESS_TOKEN_FILE: /run/secrets/access_token
INSTANCE_DIR: /instance
restart: unless-stopped
depends_on:
db:
condition: service_healthy
redis:
condition: service_healthy
ports:
- 8080:8080
healthcheck:
test: ["CMD-SHELL", "curl http://localhost:8080/api/heartbeat"]
start_period: 1m
start_interval: 5s
interval: 10m
timeout: 30s
retries: 3
secrets:
db_user:
file: ./secrets_user.txt
db_passwd:
file: ./secrets_passwd.txt
db_conn_url:
file: ./secrets_db_conn_url.txt
redis_conn_url:
file: ./secrets_redis_conn_url.txt
access_token:
file: ./secrets_access_token.txt
volumes:
postgres_data:
backend_data:
redis_data: