-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
199 lines (192 loc) · 7.39 KB
/
docker-compose.yml
File metadata and controls
199 lines (192 loc) · 7.39 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
services:
postgres:
image: docker.io/postgres:17
container_name: clipse-postgres
restart: unless-stopped
environment:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
POSTGRES_DB: clipse
volumes:
- postgres_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
restart: unless-stopped
command: /garage server
ports:
- "3900:3900"
- "3903:3903"
volumes:
- ./services/garage/garage.toml:/etc/garage.toml:ro
- garage_data:/var/lib/garage
garage-init:
image: ${CLIPSE_GARAGE_INIT_IMAGE:-ghcr.io/fixtse/clipse-garage-init:latest}
depends_on:
garage:
condition: service_started
volumes:
- ./services/garage/garage.toml:/etc/garage.toml:ro
- garage_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:
image: ${CLIPSE_AI_IMAGE:-${CLIPSE_WHISPER_IMAGE:-ghcr.io/fixtse/clipse-ai:latest}}
container_name: clipse-ai
runtime: nvidia
restart: unless-stopped
environment:
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}
WHISPER_DEBUG: ${WHISPER_DEBUG:-false}
ports:
- "8000:8000"
volumes:
- ./models:/models
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:
image: ${CLIPSE_MIGRATE_IMAGE:-ghcr.io/fixtse/clipse-migrate:latest}
container_name: clipse-db-migrate
restart: "no"
environment:
DATABASE_URL: postgresql://postgres:postgres@postgres:5432/clipse
depends_on:
postgres:
condition: service_healthy
command: pnpm db:migrate
app:
image: ${CLIPSE_APP_IMAGE:-ghcr.io/fixtse/clipse-app:latest}
container_name: clipse-app
restart: unless-stopped
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}
NODE_ENV: production
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:
- ${HOST_CODEX_HOME:-${HOME}/.codex}:/root/.codex
worker:
image: ${CLIPSE_WORKER_IMAGE:-ghcr.io/fixtse/clipse-worker:latest}
container_name: clipse-worker
runtime: nvidia
restart: unless-stopped
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}
NODE_ENV: production
NEXT_TELEMETRY_DISABLED: 1
depends_on:
db-migrate:
condition: service_completed_successfully
garage-init:
condition: service_completed_successfully
ai:
condition: service_healthy
volumes:
- worker_yolo_config:/clipse-yolo
- ./models:/models
- ${HOST_CODEX_HOME:-${HOME}/.codex}:/root/.codex
command: pnpm worker:docker
volumes:
postgres_data:
driver: local
garage_data:
driver: local
worker_yolo_config:
driver: local