-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathdocker-compose-testing.yml
63 lines (58 loc) · 1.44 KB
/
docker-compose-testing.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
---
version: "3.9"
services:
app:
build:
context: .
dockerfile: Dockerfile
args:
PYTHON_TAG: "${PYTHON_TAG:-3.12-alpine}"
image: "petinvent_app:${APP_TAG:-latest}"
container_name: "petinvent_app"
hostname: "app"
restart: "unless-stopped"
env_file:
- .env
depends_on:
db:
condition: service_healthy
networks:
- "database_network"
ports:
- "${WSGI_PORT:-5000}:5000"
healthcheck:
test: ["CMD", "wget", "--no-verbose", "--tries=1", "--spider", "http://localhost:5000/health"]
interval: 5s
timeout: 10s
retries: 20
db:
hostname: "${DB_HOSTNAME:?err}"
container_name: "petinvent_db"
image: "postgres:${POSTGRES_TAG:-15-alpine}"
volumes:
- "petinvent_db_data:/var/lib/postgresql/data"
# ports:
# - "5432:${DATABASE_PORT:-5432}"
networks:
- "database_network"
restart: "unless-stopped"
environment:
- "POSTGRES_DB=${POSTGRES_DB:?err}"
- "POSTGRES_USER=${POSTGRES_USER:?err}"
- "POSTGRES_PASSWORD=${POSTGRES_PASSWORD:?err}"
- "TZ=${TZ:-Etc/UTC}"
- "PGTZ=${TZ:-Etc/UTC}"
healthcheck:
test: ["CMD-SHELL", "pg_isready"]
interval: 10s
timeout: 5s
retries: 5
networks:
database_network:
driver: bridge
external: false
name: database_network
volumes:
petinvent_db_data:
external: false
name: petinvent_db_data