-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
69 lines (65 loc) · 1.54 KB
/
docker-compose.yml
File metadata and controls
69 lines (65 loc) · 1.54 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
65
66
67
68
69
services:
devcontainer:
image: python:3.12
volumes:
- .:/workspace:cached
- /var/run/docker.sock:/var/run/docker.sock
networks:
- app-network
working_dir: /workspace
depends_on:
postgres:
condition: service_healthy
etl:
condition: service_completed_successfully
healthcheck:
test: ["CMD", "pgrep", "-f", "sleep infinity"]
interval: 10s
timeout: 5s
retries: 3
start_period: 30s
command: bash -c "
apt-get update &&
apt-get install -y docker.io postgresql-client &&
pip install -r /workspace/requirements.txt &&
sleep infinity
"
etl:
image: python:3.12
volumes:
- .:/workspace:cached
networks:
- app-network
working_dir: /workspace
depends_on:
postgres:
condition: service_healthy
command: bash -c "
pip install -r /workspace/requirements.txt &&
cd /workspace/data_contract_components/data_assets &&
alembic upgrade head &&
python3 seed_db.py
"
postgres:
image: postgres:17-alpine
ports:
- "5432:5432"
healthcheck:
test: ["CMD-SHELL", "pg_isready -U postgres"]
interval: 5s
timeout: 10s
retries: 3
restart: unless-stopped
volumes:
- postgres-data:/var/lib/postgresql/data
environment:
POSTGRES_PASSWORD: postgres
POSTGRES_USER: postgres
POSTGRES_DB: postgres
networks:
- app-network
volumes:
postgres-data:
networks:
app-network:
driver: bridge