-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.dev.yml
More file actions
112 lines (107 loc) · 3.13 KB
/
docker-compose.dev.yml
File metadata and controls
112 lines (107 loc) · 3.13 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
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
# Dev profile: PG + 1 controller + 1 executor.
# Run via: docker compose -f docker-compose.dev.yml up -d --build
services:
postgres:
image: postgres:16-alpine
container_name: dlw-postgres-dev
environment:
POSTGRES_USER: dlw
POSTGRES_PASSWORD: dlw_dev_password
POSTGRES_DB: dlw
ports:
- "5432:5432"
volumes:
- dlw-pg-data:/var/lib/postgresql/data
healthcheck:
test: ["CMD-SHELL", "pg_isready -U dlw -d dlw"]
interval: 5s
timeout: 5s
retries: 10
controller:
build:
context: .
dockerfile: Dockerfile.executor
container_name: dlw-controller-dev
depends_on:
postgres:
condition: service_healthy
environment:
DLW_DB_HOST: postgres
DLW_DB_PORT: "5432"
DLW_DB_USER: dlw
DLW_DB_PASSWORD: dlw_dev_password
DLW_DB_NAME: dlw
DLW_BEARER_TOKEN: dev-token-change-me
DLW_HF_ENDPOINT: ${DLW_HF_ENDPOINT:-https://huggingface.co}
DLW_HF_TOKEN: ${DLW_HF_TOKEN:-}
ports:
- "8000:8000"
entrypoint: []
# W3-I: set -e so alembic failure aborts the container
command:
- sh
- -c
- "set -e && alembic upgrade head && uvicorn dlw.main:app --host 0.0.0.0 --port 8000"
# W3-H: healthcheck on /health/ready so executor's depends_on: service_healthy
# waits for migration + uvicorn before starting
healthcheck:
test: ["CMD-SHELL", "curl -sf http://localhost:8000/health/ready || exit 1"]
interval: 3s
timeout: 5s
retries: 10
start_period: 30s
executor:
build:
context: .
dockerfile: Dockerfile.executor
container_name: dlw-executor-dev
depends_on:
controller:
condition: service_healthy
minio:
condition: service_healthy
init-bucket:
condition: service_completed_successfully
environment:
DLW_EXECUTOR_ID: docker-host-worker-1
DLW_EXECUTOR_HOST_ID: docker-host
DLW_EXECUTOR_CONTROLLER_URL: http://controller:8000
DLW_EXECUTOR_BEARER_TOKEN: dev-token-change-me
DLW_EXECUTOR_DOWNLOAD_DIR: /downloads
AWS_ACCESS_KEY_ID: minioadmin
AWS_SECRET_ACCESS_KEY: minioadmin
AWS_S3_ENDPOINT_URL: http://minio:9000
DLW_EXECUTOR_S3_ENDPOINT_URL: http://minio:9000
DLW_EXECUTOR_HF_ENDPOINT: ${DLW_EXECUTOR_HF_ENDPOINT:-https://huggingface.co}
DLW_EXECUTOR_HF_TOKEN: ${DLW_EXECUTOR_HF_TOKEN:-}
volumes:
- dlw-downloads:/downloads
minio:
image: minio/minio:latest
command: server /data --console-address ":9001"
environment:
MINIO_ROOT_USER: minioadmin
MINIO_ROOT_PASSWORD: minioadmin
ports:
- "9000:9000"
- "9001:9001"
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:9000/minio/health/ready"]
interval: 5s
timeout: 3s
retries: 10
init-bucket:
image: minio/mc:latest
depends_on:
minio:
condition: service_healthy
entrypoint: >-
/bin/sh -c "
set -e;
mc alias set local http://minio:9000 minioadmin minioadmin;
mc mb -p local/modelpull-dev || true;
"
restart: "no"
volumes:
dlw-pg-data:
dlw-downloads: