-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose-prod.yml
67 lines (62 loc) · 1.34 KB
/
docker-compose-prod.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
version: '1.0'
services:
postgresql_db:
image: postgres:15.1
expose:
- 5432
env_file:
- db.postgresql.env
restart: always
volumes:
- ./db_volumes/postgresql:/var/lib/postgresql/data/
healthcheck:
test: ["CMD", "pg_isready", "-U", "fastapi_tutorial"]
interval: 2s
timeout: 5s
retries: 3
# mysql_db:
# image: mysql:8.1.0
# expose:
# - 3306
# env_file:
# - db.mysql.env
# restart: always
# volumes:
# - ./db_volumes/mysql:/var/lib/mysql/
# healthcheck:
# test: ["CMD", "echo" , ">/dev/tcp/localhost/3306"]
# interval: 2s
# timeout: 5s
# retries: 3
redis_db:
image: redis:7.2.1
expose:
- 6379
restart: always
volumes:
- ./db_volumes/redis:/data/
healthcheck:
test: ["CMD", "redis-cli", "ping"]
interval: 2s
timeout: 5s
retries: 3
backend:
build: ./backend
ports:
- 8000:8003
# volumes:
# - ./backend/:/usr/backend/
command: python3 run.py --prod
env_file:
- ./backend/.env/.prod.env
restart: always
depends_on:
redis_db:
condition: service_healthy
postgresql_db:
condition: service_healthy
# mysql_db:
# condition: service_healthy
networks:
default:
name: fastapi_tutorial_network