-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.debug.yml
73 lines (68 loc) · 1.61 KB
/
docker-compose.debug.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
services:
db:
image: postgres:16.1
container_name: db
environment:
- POSTGRES_USER=${RDS_USERNAME}
- POSTGRES_PASSWORD=${RDS_PASSWORD}
- POSTGRES_DB=${RDS_DB_NAME}
volumes:
- db-volume:/var/lib/postgresql/datascalable
healthcheck:
# checking when the database is ready for the flask app to wait
test: ["CMD-SHELL", "pg_isready -U ${RDS_USERNAME} -d ${RDS_DB_NAME}"]
interval: 5s
timeout: 20s
retries: 5
redis:
image: redis:7.2.3
container_name: redis
healthcheck:
test: ["CMD", "redis-cli", "ping"]
interval: 10s
timeout: 5s
retries: 3
flask:
build: ./flask
container_name: flask
env_file:
- .env
command: python application.py
depends_on:
# waiting for the upstream containers to be ready
redis:
condition: service_healthy
db:
condition: service_healthy
volumes:
- ./flask:/app
flask_2:
build: ./flask
container_name: flask_2
env_file:
- .env
command: python application.py
depends_on:
# waiting for the upstream containers to be ready
redis:
condition: service_healthy
db:
condition: service_healthy
volumes:
- ./flask:/app
nginx:
image: nginx:latest
container_name: nginx
ports:
- "1015:80"
# - "443:443"
volumes:
- ./nginx/conf.d:/etc/nginx/conf.d
- ./nginx/nginx.conf:/etc/nginx/nginx.conf
# - ./nginx/ssl-certs:/etc/nginx/ssl-certs
depends_on:
- flask
- flask_2
# to persist container volumes
volumes:
db-volume: