-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
44 lines (43 loc) · 1.06 KB
/
docker-compose.yml
File metadata and controls
44 lines (43 loc) · 1.06 KB
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
services:
flask_app:
container_name: flask_app
image: flask_crud_api:1.0.0
restart: always
build: .
environment:
- APP_HOST=${APP_HOST}
- APP_PORT=${APP_PORT}
- DB_URL=${DB_URL}
ports:
- "${APP_PORT}:${APP_PORT}"
healthcheck:
test: ["CMD", "curl", "-f", "http://${APP_HOST}:${APP_PORT}/health"]
interval: 30s
timeout: 10s
retries: 5
start_period: 5s
depends_on:
flask_db:
condition: service_healthy
restart: true
flask_db:
container_name: flask_db
image: postgres:15
restart: always
environment:
- POSTGRES_PORT=${POSTGRES_PORT}
- POSTGRES_USER=${POSTGRES_USER}
- POSTGRES_PASSWORD=${POSTGRES_PASSWORD}
- POSTGRES_DB=${POSTGRES_DB}
ports:
- "${POSTGRES_PORT}:${POSTGRES_PORT}"
healthcheck:
test: ["CMD-SHELL", "pg_isready -U ${POSTGRES_USER} -d ${POSTGRES_DB}"]
interval: 10s
retries: 5
start_period: 30s
timeout: 10s
volumes:
- pgdata:/var/lib/postgresql/data
volumes:
pgdata: {}