-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yaml
More file actions
95 lines (87 loc) · 2.32 KB
/
docker-compose.yaml
File metadata and controls
95 lines (87 loc) · 2.32 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
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
# This is a Docker Compose configuration for local use.
# Run all services:
# docker compose up --build --wait
services:
api:
build: .
restart: no
depends_on:
db:
condition: service_healthy
alembic-migrate:
condition: service_completed_successfully
validate-data:
condition: service_completed_successfully
ports:
- "8005:8000"
volumes:
- "./settings.yaml:/app/settings.yaml:ro" # Read-only settings file
alembic-migrate:
build: .
restart: no
depends_on:
db:
condition: service_healthy
volumes:
- "./settings.yaml:/app/settings.yaml:ro" # Read-only settings file
command: alembic upgrade head
db:
# See more: https://hub.docker.com/_/postgres
image: "postgres:17.1"
restart: no
ports:
- "5432:5432"
volumes:
- "postgres:/var/lib/postgresql/data"
healthcheck:
test: [ "CMD-SHELL", "pg_isready -U postgres" ]
timeout: 5s
start_period: 30s
interval: 1m
environment:
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:-postgres}
validate-data:
build: .
restart: no
depends_on:
alembic-migrate:
condition: service_completed_successfully
volumes:
- "./settings.yaml:/app/settings.yaml:ro" # Read-only settings file
command: python -m scripts.validate_data
environment:
PYTHONPATH: /app
validate-data-cron:
build: .
restart: unless-stopped
depends_on:
db:
condition: service_healthy
alembic-migrate:
condition: service_completed_successfully
volumes:
- "./settings.yaml:/app/settings.yaml:ro" # Read-only settings file
command: >
sh -c 'while true; do
echo "[$(date)] Running scheduled validation...";
python -m scripts.validate_data || echo "Validation failed";
sleep 3600;
done'
environment:
PYTHONPATH: /app
minio:
# See more: https://hub.docker.com/r/minio/minio
image: "minio/minio:RELEASE.2024-05-10T01-41-38Z"
restart: no
ports:
- "9000:9000"
- "9001:9001"
volumes:
- "minio:/data"
command: server /data --console-address ":9001"
environment:
MINIO_ROOT_USER: ${MINIO_ROOT_USER:-minioadmin}
MINIO_ROOT_PASSWORD: ${MINIO_ROOT_PASSWORD:-password}
volumes:
postgres:
minio: