-
Notifications
You must be signed in to change notification settings - Fork 0
/
compose.dev.yml
110 lines (104 loc) · 2.24 KB
/
compose.dev.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
110
services:
server:
build:
context: .
dockerfile: ./server/Dockerfile
command: [ "/bin/sh", "-c", "fastapi dev 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
environment:
- ENV_MODE=development
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
pgadmin:
image: dpage/pgadmin4:latest
volumes:
- ./pgadmin/config/servers.json:/pgadmin4/servers.json
environment:
PGADMIN_DEFAULT_EMAIL: [email protected]
PGADMIN_DEFAULT_PASSWORD: password
PGADMIN_CONFIG_SERVER_MODE: "False"
PGADMIN_CONFIG_MASTER_PASSWORD_REQUIRED: "False"
ports:
- "127.0.0.1:8001:80"
restart: unless-stopped
depends_on:
db:
condition: service_healthy
db-migrator:
condition: service_completed_successfully
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/Dockerfile
tty: true
volumes:
- ./db:/app
env_file:
- ./envs/db.env
restart: no
depends_on:
db:
condition: service_healthy
networks:
- db
volumes:
pg_data:
redis_data:
networks:
db:
driver: bridge
redis:
driver: bridge