-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
64 lines (60 loc) · 1.47 KB
/
Copy pathdocker-compose.yml
File metadata and controls
64 lines (60 loc) · 1.47 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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
services:
db:
container_name: postgres-db
image: postgres:17
environment:
POSTGRES_DB: ${DB_NAME:-test_db}
POSTGRES_USER: ${DB_USER:-user}
POSTGRES_PASSWORD: ${DB_PASSWORD:-password}
ports:
- "127.0.0.1:5432:5432"
volumes:
- postgres_data:/var/lib/postgresql/data
- ./sql/init.sql:/docker-entrypoint-initdb.d/init.sql:ro
networks:
- db_network
healthcheck:
test: ["CMD", "pg_isready", "-U", "${DB_USER:-user}", "-d", "${DB_NAME:-test_db}"]
interval: 5s
retries: 10
start_period: 10s
timeout: 5s
seed:
build: .
container_name: sqlperf-seed
command: ["python", "-m", "sql.seed"]
environment:
DB_HOST: postgres-db
DB_NAME: ${DB_NAME:-test_db}
DB_USER: ${DB_USER:-user}
DB_PASSWORD: ${DB_PASSWORD:-password}
DB_SEED_SIZE: ${DB_SEED_SIZE:-medium}
networks:
- db_network
depends_on:
db:
condition: service_healthy
restart: "no"
app:
container_name: python-app
build: .
environment:
DB_HOST: postgres-db
DB_NAME: ${DB_NAME:-test_db}
DB_USER: ${DB_USER:-user}
DB_PASSWORD: ${DB_PASSWORD:-password}
LOG_LEVEL: ${LOG_LEVEL:-INFO}
networks:
- db_network
depends_on:
seed:
condition: service_completed_successfully
volumes:
- results:/app/results
ports:
- "127.0.0.1:8000:8000"
volumes:
postgres_data:
results:
networks:
db_network: