-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.dev.yml
More file actions
220 lines (213 loc) · 7.84 KB
/
docker-compose.dev.yml
File metadata and controls
220 lines (213 loc) · 7.84 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
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
services:
postgres:
image: docker.io/postgres:17
container_name: clipse-postgres-dev
restart: unless-stopped
environment:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
POSTGRES_DB: clipse
ports:
- "5433:5432"
volumes:
- postgres_dev_data:/var/lib/postgresql/data
healthcheck:
test: ["CMD-SHELL", "pg_isready -U postgres -d clipse"]
interval: 10s
timeout: 5s
retries: 5
garage:
image: docker.io/dxflrs/garage:v2.2.0
container_name: clipse-garage-dev
restart: unless-stopped
command: /garage server
ports:
- "3900:3900"
- "3903:3903"
volumes:
- ./services/garage/garage.toml:/etc/garage.toml:ro
- garage_dev_data:/var/lib/garage
garage-init:
build:
context: .
dockerfile: services/garage/Dockerfile.init
depends_on:
garage:
condition: service_started
volumes:
- ./services/garage/garage.toml:/etc/garage.toml:ro
- garage_dev_data:/var/lib/garage
command:
- |
set -eu;
echo "[garage-init] Waiting for Garage admin API...";
attempts=0;
until /garage status >/garage-status 2>/dev/null; do
attempts=$$((attempts + 1));
if [ "$$attempts" -ge 60 ]; then
echo "[garage-init] Garage did not become ready after 60 seconds.";
exit 1;
fi;
/bin/busybox sleep 1;
done;
echo "[garage-init] Garage is reachable.";
if /bin/busybox grep -q "NO ROLE ASSIGNED" /garage-status; then
node_id="$$(/bin/busybox awk '/^[0-9a-f]{16}/ { print $$1; exit }' /garage-status)";
if [ -z "$$node_id" ]; then
echo "[garage-init] Could not find a Garage node id in /garage status output.";
/bin/busybox cat /garage-status;
exit 1;
fi;
echo "[garage-init] Assigning local Garage node $$node_id.";
/garage layout assign -z local -c 1G "$$node_id";
/garage layout apply --version 1;
fi;
echo "[garage-init] Ensuring local key and bucket exist.";
/garage key info clipse >/dev/null 2>&1 || /garage key import --yes -n clipse GK000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000;
/garage bucket info clipse >/dev/null 2>&1 || /garage bucket create clipse;
/garage bucket allow --read --write --owner clipse --key clipse;
echo "[garage-init] Garage bucket initialization complete."
ai:
build:
context: ./services/whisper
dockerfile: Dockerfile
container_name: clipse-ai-dev
runtime: nvidia
environment:
WHISPER_DEBUG: ${WHISPER_DEBUG:-false}
WHISPER_DEVICE: cuda
WHISPER_COMPUTE_TYPE: float16
WHISPER_CPU_FALLBACK: "false"
HF_HOME: /models/whisper
HUGGINGFACE_HUB_CACHE: /models/whisper/hub
NVIDIA_VISIBLE_DEVICES: ${NVIDIA_VISIBLE_DEVICES:-all}
NVIDIA_DRIVER_CAPABILITIES: ${NVIDIA_DRIVER_CAPABILITIES:-compute,utility,video}
ports:
- "8000:8000"
volumes:
- ${WHISPER_CACHE_DIR:-./models/whisper}:/models/whisper
healthcheck:
test:
[
"CMD-SHELL",
"python -c \"import urllib.request; urllib.request.urlopen('http://127.0.0.1:8000/health', timeout=2).read()\"",
]
interval: 10s
timeout: 5s
retries: 12
start_period: 15s
db-migrate:
build:
context: .
dockerfile: services/postgres/Dockerfile.migrate
container_name: clipse-db-migrate-dev
environment:
DATABASE_URL: postgresql://postgres:postgres@postgres:5432/clipse
depends_on:
postgres:
condition: service_healthy
command: pnpm db:migrate
app:
build:
context: .
dockerfile: apps/web/Dockerfile.dev
container_name: clipse-app-dev
env_file:
- .env
environment:
DATABASE_URL: postgresql://postgres:postgres@postgres:5432/clipse
CLIPSE_S3_ENDPOINT: http://garage:3900
CLIPSE_S3_PUBLIC_ENDPOINT: ${CLIPSE_S3_PUBLIC_ENDPOINT:-http://localhost:3900}
CLIPSE_S3_REGION: ${CLIPSE_S3_REGION:-garage}
CLIPSE_S3_BUCKET: ${CLIPSE_S3_BUCKET:-clipse}
CLIPSE_S3_ACCESS_KEY_ID: ${CLIPSE_S3_ACCESS_KEY_ID:-GK000000000000000000000000}
CLIPSE_S3_SECRET_ACCESS_KEY: ${CLIPSE_S3_SECRET_ACCESS_KEY:-0000000000000000000000000000000000000000000000000000000000000000}
CLIPSE_S3_FORCE_PATH_STYLE: ${CLIPSE_S3_FORCE_PATH_STYLE:-true}
WHISPER_SERVICE_URL: http://ai:8000
CLIPSE_HAILO_SERVICE_URL: http://ai:8000
CLIPSE_FOCUS_PROVIDER: ${CLIPSE_FOCUS_PROVIDER:-auto}
CLIPSE_FOCUS_DEBUG: ${CLIPSE_FOCUS_DEBUG:-${WHISPER_DEBUG:-false}}
CLIPSE_YTDLP_COOKIES_FILE: ${CLIPSE_YTDLP_COOKIES_FILE:-}
CLIPSE_YTDLP_USER_AGENT: ${CLIPSE_YTDLP_USER_AGENT:-}
CLIPSE_CODEX_COMMAND: ${CLIPSE_CODEX_COMMAND:-codex}
CLIPSE_CODEX_HOME: ${CLIPSE_CODEX_HOME:-/root/.codex}
CLIPSE_CODEX_CWD: /app
CLIPSE_CODEX_TIMEOUT_MS: ${CLIPSE_CODEX_TIMEOUT_MS:-300000}
NEXT_TELEMETRY_DISABLED: 1
depends_on:
db-migrate:
condition: service_completed_successfully
garage-init:
condition: service_completed_successfully
ai:
condition: service_healthy
ports:
- "3000:3000"
volumes:
- .:/app
- app_node_modules:/app/node_modules
- app_pnpm_store:/pnpm/store
- ${HOST_CODEX_HOME:-${HOME}/.codex}:/root/.codex
command: sh -c "pnpm install --store-dir /pnpm/store --no-frozen-lockfile && pnpm dev"
worker:
build:
context: .
dockerfile: apps/worker/Dockerfile.dev
container_name: clipse-worker-dev
runtime: nvidia
env_file:
- .env
environment:
DATABASE_URL: postgresql://postgres:postgres@postgres:5432/clipse
CLIPSE_S3_ENDPOINT: http://garage:3900
CLIPSE_S3_PUBLIC_ENDPOINT: ${CLIPSE_S3_PUBLIC_ENDPOINT:-http://localhost:3900}
CLIPSE_S3_REGION: ${CLIPSE_S3_REGION:-garage}
CLIPSE_S3_BUCKET: ${CLIPSE_S3_BUCKET:-clipse}
CLIPSE_S3_ACCESS_KEY_ID: ${CLIPSE_S3_ACCESS_KEY_ID:-GK000000000000000000000000}
CLIPSE_S3_SECRET_ACCESS_KEY: ${CLIPSE_S3_SECRET_ACCESS_KEY:-0000000000000000000000000000000000000000000000000000000000000000}
CLIPSE_S3_FORCE_PATH_STYLE: ${CLIPSE_S3_FORCE_PATH_STYLE:-true}
WHISPER_SERVICE_URL: http://ai:8000
CLIPSE_HAILO_SERVICE_URL: http://ai:8000
CLIPSE_FOCUS_PROVIDER: ${CLIPSE_FOCUS_PROVIDER:-auto}
CLIPSE_FOCUS_DEBUG: ${CLIPSE_FOCUS_DEBUG:-${WHISPER_DEBUG:-false}}
CLIPSE_YTDLP_COOKIES_FILE: ${CLIPSE_YTDLP_COOKIES_FILE:-}
CLIPSE_YTDLP_USER_AGENT: ${CLIPSE_YTDLP_USER_AGENT:-}
CLIPSE_CODEX_COMMAND: ${CLIPSE_CODEX_COMMAND:-codex}
CLIPSE_CODEX_HOME: ${CLIPSE_CODEX_HOME:-/root/.codex}
CLIPSE_CODEX_CWD: /app
CLIPSE_CODEX_TIMEOUT_MS: ${CLIPSE_CODEX_TIMEOUT_MS:-300000}
CLIPSE_YOLO_MODEL: ${CLIPSE_YOLO_MODEL:-yolo11n.pt}
YOLO_CONFIG_DIR: /clipse-yolo
NVIDIA_VISIBLE_DEVICES: ${NVIDIA_VISIBLE_DEVICES:-all}
NVIDIA_DRIVER_CAPABILITIES: ${NVIDIA_DRIVER_CAPABILITIES:-compute,utility,video}
NEXT_TELEMETRY_DISABLED: 1
depends_on:
db-migrate:
condition: service_completed_successfully
garage-init:
condition: service_completed_successfully
ai:
condition: service_healthy
volumes:
- .:/app
- worker_node_modules:/app/node_modules
- worker_pnpm_store:/pnpm/store
- worker_yolo_config:/clipse-yolo
- ./models:/models
- ${HOST_CODEX_HOME:-${HOME}/.codex}:/root/.codex
command: sh -c "pnpm install --store-dir /pnpm/store --no-frozen-lockfile && pnpm worker:dev"
volumes:
postgres_dev_data:
driver: local
garage_dev_data:
driver: local
app_node_modules:
driver: local
worker_node_modules:
driver: local
app_pnpm_store:
driver: local
worker_pnpm_store:
driver: local
worker_yolo_config:
driver: local