forked from Chevron7Locked/kima-hub
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
346 lines (321 loc) · 12.6 KB
/
docker-compose.yml
File metadata and controls
346 lines (321 loc) · 12.6 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
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
services:
# ==============================================================================
# LIDIFY CORE APPLICATION
# ==============================================================================
# Backend API - Your Lidify Express.js server
backend:
build:
context: ./backend
dockerfile: Dockerfile
container_name: lidify_backend
environment:
# Database
DATABASE_URL: postgresql://${POSTGRES_USER:-lidifydb}:${POSTGRES_PASSWORD:-changeme}@postgres:5432/${POSTGRES_DB:-lidify}
POSTGRES_USER: ${POSTGRES_USER:-lidifydb}
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:-changeme}
POSTGRES_DB: ${POSTGRES_DB:-lidify}
REDIS_URL: redis://redis:6379
# Server config
PORT: 3006
NODE_ENV: ${NODE_ENV:-production}
SESSION_SECRET: ${SESSION_SECRET:-changeme-generate-secure-key}
SETTINGS_ENCRYPTION_KEY: ${SETTINGS_ENCRYPTION_KEY:-}
# Music library (required)
# IMPORTANT: Inside Docker, music is always at /music (mounted from host MUSIC_PATH)
# Don't use ${MUSIC_PATH} here as it contains the host path, not container path
MUSIC_PATH: /music
TRANSCODE_CACHE_PATH: /app/cache/transcodes
TRANSCODE_CACHE_MAX_GB: ${TRANSCODE_CACHE_MAX_GB:-10}
IMAGE_CACHE_MAX_GB: ${IMAGE_CACHE_MAX_GB:-2}
# CORS
ALLOWED_ORIGINS: ${ALLOWED_ORIGINS:-http://localhost:3000,http://localhost:3030}
# Lidarr webhook callback URL - how Lidarr can reach Lidify
# Use backend:3006 for same-network communication, or external IP:3030 for external Lidarr
LIDIFY_CALLBACK_URL: ${LIDIFY_CALLBACK_URL:-http://backend:3006}
# Debug: enable extra podcast stream/cache logging
PODCAST_DEBUG: ${PODCAST_DEBUG:-0}
# Podcast ad removal (requires --profile ad-removal or ad-removal-gpu)
PODCAST_AD_REMOVAL: ${PODCAST_AD_REMOVAL:-false}
WHISHPER_URL: ${WHISHPER_URL:-http://whishper:8080}
# Whisper model for transcription (must be preloaded in Whishper)
WHISPER_MODEL: ${WHISPER_MODEL:-medium}
# LLM for ad detection - uses your configured OpenRouter model by default
# Set AD_REMOVAL_MODEL to override (e.g., google/gemini-2.0-flash-001)
AD_REMOVAL_MODEL: ${AD_REMOVAL_MODEL:-}
OPENROUTER_API_KEY: ${OPENROUTER_API_KEY:-}
volumes:
- ${MUSIC_PATH:-./music}:/music
- backend_cache:/app/cache
- backend_logs:/app/logs
ports:
- "${BACKEND_PORT:-3006}:3006"
depends_on:
postgres:
condition: service_healthy
redis:
condition: service_healthy
restart: unless-stopped
healthcheck:
test: ["CMD", "node", "healthcheck.js"]
interval: 30s
timeout: 10s
retries: 3
# Frontend Web UI - Your Lidify Next.js app
frontend:
build:
context: ./frontend
dockerfile: Dockerfile
args:
# Prefer relative /api requests (Next.js rewrites will proxy to backend).
# If you need a custom API URL, set NEXT_PUBLIC_API_URL explicitly.
NEXT_PUBLIC_API_URL: ${NEXT_PUBLIC_API_URL:-}
container_name: lidify_frontend
environment:
NODE_ENV: ${NODE_ENV:-production}
# Used by next.config.ts rewrites() inside the container.
# IMPORTANT: "localhost" inside a container refers to itself, not the host.
BACKEND_URL: ${BACKEND_URL:-http://backend:3006}
# Exposed to the browser; leave empty by default so the app uses /api via rewrites.
NEXT_PUBLIC_API_URL: ${NEXT_PUBLIC_API_URL:-}
ports:
- "${FRONTEND_PORT:-3030}:3030"
depends_on:
- backend
restart: unless-stopped
healthcheck:
test: ["CMD", "node", "healthcheck.js"]
interval: 30s
timeout: 10s
retries: 3
# ==============================================================================
# INFRASTRUCTURE (Database & Cache)
# ==============================================================================
postgres:
image: postgres:16-alpine
container_name: lidify_db
environment:
POSTGRES_USER: ${POSTGRES_USER:-lidifydb}
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:-changeme}
POSTGRES_DB: ${POSTGRES_DB:-lidify}
volumes:
- postgres_data:/var/lib/postgresql/data
ports:
- "${POSTGRES_PORT:-5432}:5432"
restart: unless-stopped
healthcheck:
# IMPORTANT:
# pg_isready defaults to connecting to a database with the same name as the user.
# Our default user is "lidifydb" but default database is "lidify",
# so without -d this will spam logs with: FATAL: database "lidifydb" does not exist
test:
[
"CMD-SHELL",
"pg_isready -U ${POSTGRES_USER:-lidifydb} -d ${POSTGRES_DB:-lidify}",
]
interval: 10s
timeout: 5s
retries: 5
redis:
image: redis:7-alpine
container_name: lidify_redis
ports:
- "${REDIS_PORT:-6379}:6379"
restart: unless-stopped
healthcheck:
test: ["CMD", "redis-cli", "ping"]
interval: 10s
timeout: 5s
retries: 5
# ==============================================================================
# EXTERNAL SERVICES (Music Management)
# ==============================================================================
# Lidarr - Music collection manager
lidarr:
image: lscr.io/linuxserver/lidarr:latest
container_name: lidify_lidarr
environment:
- PUID=1000
- PGID=1000
- TZ=${TZ:-UTC}
volumes:
- lidarr_config:/config
- ${MUSIC_PATH:-./music}:/music
- ${DOWNLOAD_PATH:-./downloads}:/downloads
ports:
- "8686:8686"
restart: unless-stopped
# Prowlarr - Indexer manager
prowlarr:
image: lscr.io/linuxserver/prowlarr:latest
container_name: lidify_prowlarr
environment:
- PUID=1000
- PGID=1000
- TZ=${TZ:-UTC}
volumes:
- prowlarr_config:/config
ports:
- "9696:9696"
restart: unless-stopped
# FlareSolverr - Cloudflare bypass for Prowlarr
flaresolverr:
image: ghcr.io/flaresolverr/flaresolverr:latest
container_name: lidify_flaresolverr
environment:
- LOG_LEVEL=${LOG_LEVEL:-info}
- LOG_HTML=${LOG_HTML:-false}
- CAPTCHA_SOLVER=${CAPTCHA_SOLVER:-none}
- TZ=${TZ:-UTC}
ports:
- "8191:8191"
restart: unless-stopped
# NOTE: Soulseek is now handled directly by the backend using slsk-client
# No Docker container needed - downloads go straight to Singles/Artist/Album/
# qBittorrent - Torrent client
qbittorrent:
image: lscr.io/linuxserver/qbittorrent:latest
container_name: lidify_qbittorrent
environment:
- PUID=1000
- PGID=1000
- TZ=${TZ:-UTC}
- WEBUI_PORT=8080
volumes:
- qbittorrent_config:/config
- ${MUSIC_PATH:-./music}/torrents:/music/torrents
- ${DOWNLOAD_PATH:-./downloads}:/downloads
ports:
- "8080:8080"
- "6881:6881"
- "6881:6881/udp"
restart: unless-stopped
# SABnzbd - Usenet client
sabnzbd:
image: lscr.io/linuxserver/sabnzbd:latest
container_name: lidify_sabnzbd
environment:
- PUID=1000
- PGID=1000
- TZ=${TZ:-UTC}
volumes:
- sabnzbd_config:/config
- ${DOWNLOAD_PATH:-./downloads}:/downloads
ports:
- "8085:8080"
restart: unless-stopped
# ==============================================================================
# PODCAST AD REMOVAL (Whishper + AI)
# ==============================================================================
# Whishper - Self-hosted Whisper transcription for podcast ad detection
# Enable with: docker compose --profile ad-removal up -d
# For GPU: docker compose --profile ad-removal-gpu up -d
whishper:
image: pluja/whishper:latest
container_name: lidify_whishper
environment:
# Whisper models to preload (comma-separated)
# Options: tiny, base, small, medium, large-v3
# large-v3 is most accurate but needs ~10GB VRAM
- WHISPER_MODELS=${WHISPER_MODELS:-small,medium}
# Compute type: int8 (CPU), float16 (GPU), int8_float16 (mixed)
- WHISPER_COMPUTE_TYPE=${WHISPER_COMPUTE_TYPE:-int8}
# Language: en for English, auto for auto-detect
- WHISPER_LANG=${WHISPER_LANG:-en}
# Database
- MONGO_URL=mongodb://whishper-mongo:27017/whishper
volumes:
- whishper_uploads:/app/uploads
- whishper_models:/app/models
ports:
- "${WHISHPER_PORT:-8082}:8080"
depends_on:
- whishper-mongo
restart: unless-stopped
profiles:
- ad-removal
# Whishper with GPU acceleration (NVIDIA)
# Use this instead if you have a CUDA GPU
whishper-gpu:
image: pluja/whishper:latest-gpu
container_name: lidify_whishper
environment:
# With GPU, use larger models for better accuracy
- WHISPER_MODELS=${WHISPER_MODELS:-medium,large-v3}
# float16 for GPU (fastest), int8_float16 for lower VRAM
- WHISPER_COMPUTE_TYPE=${WHISPER_COMPUTE_TYPE:-float16}
- WHISPER_LANG=${WHISPER_LANG:-en}
- MONGO_URL=mongodb://whishper-mongo:27017/whishper
volumes:
- whishper_uploads:/app/uploads
- whishper_models:/app/models
ports:
- "${WHISHPER_PORT:-8082}:8080"
depends_on:
- whishper-mongo
restart: unless-stopped
deploy:
resources:
reservations:
devices:
- driver: nvidia
count: 1
capabilities: [gpu]
profiles:
- ad-removal-gpu
# MongoDB for Whishper (stores transcription jobs/history)
whishper-mongo:
image: mongo:7
container_name: lidify_whishper_mongo
volumes:
- whishper_mongo_data:/data/db
restart: unless-stopped
profiles:
- ad-removal
# ==============================================================================
# AUDIO ANALYSIS SERVICE (Essentia)
# ==============================================================================
# Audio Analyzer - Extracts BPM, key, mood, and other audio features
audio-analyzer:
build:
context: ./services/audio-analyzer
container_name: lidify_audio_analyzer
environment:
REDIS_URL: redis://redis:6379
DATABASE_URL: postgresql://${POSTGRES_USER:-lidifydb}:${POSTGRES_PASSWORD:-changeme}@postgres:5432/${POSTGRES_DB:-lidify}
MUSIC_PATH: /music
DOWNLOAD_PATH: /soulseek-downloads
BATCH_SIZE: ${AUDIO_ANALYSIS_BATCH_SIZE:-10}
SLEEP_INTERVAL: ${AUDIO_ANALYSIS_INTERVAL:-5}
NUM_WORKERS: ${AUDIO_ANALYSIS_WORKERS:-8}
volumes:
- ${MUSIC_PATH:-./music}:/music:ro
- ${DOWNLOAD_PATH:-./soulseek-downloads}:/soulseek-downloads:ro
- audio_analyzer_models:/app/models
depends_on:
postgres:
condition: service_healthy
redis:
condition: service_healthy
restart: unless-stopped
# Disabled by default - enable when needed
profiles:
- audio-analysis
volumes:
# Lidify core
postgres_data:
backend_cache:
backend_logs:
# Audio analysis
audio_analyzer_models:
# Podcast ad removal (Whishper)
whishper_uploads:
whishper_models:
whishper_mongo_data:
# External services
lidarr_config:
prowlarr_config:
qbittorrent_config:
sabnzbd_config:
networks:
default:
name: lidify_network