Files
insta-recipe/docker-compose.yml
Giancarmine Salucci 5b5bb947ef feat: replace Playwright extractor with yt-dlp subprocess
- Add instagram-extractor.ts: yt-dlp subprocess backend for Instagram
  caption extraction. No in-process browser state, maintained against
  Instagram frontend churn, supports cookies.txt for auth-walled reels.
- Add feature flag EXTRACTOR_BACKEND (ytdlp|playwright) in QueueProcessor
  so the old Playwright path remains available as fallback.
- Add 9 unit tests and 2 live-network integration tests for the new extractor.
- Dockerfile: install yt-dlp via pip3 alongside existing Chromium deps.
- docker-compose: expose EXTRACTOR_BACKEND env var (default: ytdlp).

Also in this commit:
- LLM: configurable per-request timeout via LLM_REQUEST_TIMEOUT_MS (default 120s);
  set maxRetries=0 to surface errors immediately; llama-swap /running health probe.
- QueueProcessor: thread progress callback through parser phase.
- LlmHealthIndicator: surface llama-swap loaded-model name.
- Logging: improve error serialization in queue-processor tests.
- .env.example: document llama-swap endpoint and model options.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-05-12 20:46:31 +02:00

57 lines
1.6 KiB
YAML

services:
app:
build: .
container_name: insta-recipe
network_mode: host
ports:
- '3000:3000'
environment:
# LLM Configuration (Required)
- OPENAI_BASE_URL=${OPENAI_BASE_URL}
- OPENAI_API_KEY=${OPENAI_API_KEY}
- LLM_MODEL=${LLM_MODEL:-google/gemma-3-4b}
# Queue Configuration (Optional)
- QUEUE_CONCURRENCY=${QUEUE_CONCURRENCY:-2}
- QUEUE_MAX_RETRIES=${QUEUE_MAX_RETRIES:-3}
# Tandoor Integration (Optional)
- TANDOOR_ENABLED=${TANDOOR_ENABLED:-false}
- TANDOOR_SERVER_URL=${TANDOOR_SERVER_URL}
- TANDOOR_SPACE=${TANDOOR_SPACE:-1}
- TANDOOR_TOKEN=${TANDOOR_TOKEN}
# Push Notifications (Optional)
- VAPID_PUBLIC_KEY=${VAPID_PUBLIC_KEY}
- VAPID_PRIVATE_KEY=${VAPID_PRIVATE_KEY}
# Authentication Scheduler (Optional)
- AUTH_SCHEDULER_ENABLED=${AUTH_SCHEDULER_ENABLED:-false}
- AUTH_SCHEDULER_INTERVAL_MINUTES=${AUTH_SCHEDULER_INTERVAL_MINUTES:-720}
# Playwright Configuration
- DISPLAY=:99
# Extractor backend: 'ytdlp' (default) or 'playwright' (legacy fallback)
- EXTRACTOR_BACKEND=${EXTRACTOR_BACKEND:-ytdlp}
# Node.js Environment
- NODE_ENV=production
security_opt:
- seccomp=unconfined
volumes:
- ./secrets:/app/secrets
restart: unless-stopped
healthcheck:
test:
[
'CMD',
'node',
'-e',
"fetch('http://localhost:3000/api/health').then(r => r.ok ? process.exit(0) : process.exit(1)).catch(() => process.exit(1))"
]
interval: 30s
timeout: 10s
retries: 3
start_period: 40s