-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcompose.test.yml
109 lines (103 loc) · 2.15 KB
/
compose.test.yml
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
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
services:
server:
build:
context: .
dockerfile: ./server/Dockerfile
command: [ "/bin/sh", "-c", "NEW_RELIC_CONFIG_FILE=newrelic.ini NEW_RELIC_ENVIRONMENT=test newrelic-admin run-program fastapi run main.py --host 0.0.0.0 --port 80 --proxy-headers" ]
ports:
- "127.0.0.1:8000:80"
volumes:
- ./server:/app
- ./db:/app/db
- ./redis:/app/redis_crud
env_file:
- ./envs/db.env
- ./envs/server.env
- ./envs/sentry.env
environment:
- ENV_MODE=production
restart: unless-stopped
healthcheck:
test: [ "CMD", "curl", "-f", "http://localhost:80/system/healthcheck/" ]
interval: 5s
timeout: 5s
retries: 10
start_period: 5s
depends_on:
db:
condition: service_healthy
redis:
condition: service_healthy
db-migrator:
condition: service_completed_successfully
networks:
- db
- redis
db:
image: postgres:17
env_file:
- ./envs/db.env
environment:
POSTGRES_DB: main
volumes:
- pg_data:/var/lib/postgresql/data
restart: unless-stopped
healthcheck:
test: pg_isready -U user -d main
interval: 2s
timeout: 5s
retries: 30
networks:
- db
redis:
image: redis:7.4.1
volumes:
- redis_data:/data
restart: unless-stopped
healthcheck:
test: redis-cli ping
interval: 2s
timeout: 5s
retries: 30
networks:
- redis
db-migrator:
build:
context: .
dockerfile: db/migrator.Dockerfile
tty: true
volumes:
- ./db:/app
env_file:
- ./envs/db.env
restart: no
depends_on:
db:
condition: service_healthy
networks:
- db
db-dumper:
build:
context: .
dockerfile: db/dumper.Dockerfile
env_file:
- ./envs/db.env
- ./envs/sentry.env
environment:
- POSTGRES_HOST=db
- POSTGRES_DB=main
restart:
unless-stopped
depends_on:
db:
condition: service_healthy
networks:
- db
volumes:
pg_data:
redis_data:
networks:
db:
driver: bridge
redis:
driver: bridge