clipwright/docker-compose.cloud.yml
juancarlos.cavero ebe876c497 feat: unlock 720p/1080p YouTube downloads (Deno + bgutil PO tokens)
YouTube now forces SABR streaming, capping downloads at 360p without a GVS PO
token. Adds the full recipe (cloud mode only):
- Dockerfile: Deno JS runtime (nsig challenge) + latest yt-dlp[default] nightly
  + bgutil-ytdlp-pot-provider plugin
- docker-compose.cloud.yml: bgutil PO-token sidecar + BGUTIL_BASE_URL
- main.py / metering.py: when BGUTIL_BASE_URL is set, use yt-dlp default clients
  + the bgutil HTTP provider (→ 720p); self-host keeps the conservative fallback

Verified E2E through the container: managed user -> YouTube -> DataImpulse
residential proxy + Deno + bgutil -> real 720p (format 136) download, no 403.
2026-07-14 13:42:07 +02:00

63 lines
2.5 KiB
YAML

# Cloud (paid / managed-keys) mode override for openshorts.app.
# Usage:
# docker compose -f docker-compose.yml -f docker-compose.cloud.yml up --build
#
# The base docker-compose.yml is untouched and keeps working as pure BYOK for
# self-hosters. This file only adds the Postgres service and the cloud env.
services:
db:
image: postgres:16-alpine
container_name: openshorts-db
environment:
- POSTGRES_USER=openshorts
- POSTGRES_PASSWORD=${POSTGRES_PASSWORD:-openshorts}
- POSTGRES_DB=openshorts
volumes:
- pgdata:/var/lib/postgresql/data
healthcheck:
test: ["CMD-SHELL", "pg_isready -U openshorts"]
interval: 5s
timeout: 3s
retries: 10
restart: unless-stopped
# PO-token provider — lets yt-dlp fetch YouTube's GVS PO tokens so 720p/1080p
# formats are available (with Deno + a recent yt-dlp in the backend image).
bgutil:
image: brainicism/bgutil-ytdlp-pot-provider
container_name: openshorts-bgutil
restart: unless-stopped
backend:
depends_on:
db:
condition: service_healthy
bgutil:
condition: service_started
environment:
- BILLING_ENABLED=true
- DATABASE_URL=postgresql+asyncpg://openshorts:${POSTGRES_PASSWORD:-openshorts}@db:5432/openshorts
- JWT_SECRET=${JWT_SECRET}
- FRONTEND_URL=${FRONTEND_URL:-https://openshorts.app}
- ALLOWED_ORIGINS=${ALLOWED_ORIGINS:-https://openshorts.app}
# Email (magic link) — Resend
- RESEND_API_KEY=${RESEND_API_KEY}
- EMAIL_FROM=${EMAIL_FROM:-OpenShorts <login@openshorts.app>}
# Google OAuth
- GOOGLE_CLIENT_ID=${GOOGLE_CLIENT_ID}
- GOOGLE_CLIENT_SECRET=${GOOGLE_CLIENT_SECRET}
# Stripe (prices are resolved by lookup_key at runtime — no price IDs needed)
- STRIPE_SECRET_KEY=${STRIPE_SECRET_KEY}
- STRIPE_WEBHOOK_SECRET=${STRIPE_WEBHOOK_SECRET}
# Managed provider keys (server-owned)
- MANAGED_GEMINI_API_KEY=${MANAGED_GEMINI_API_KEY}
- MANAGED_UPLOAD_POST_API_KEY=${MANAGED_UPLOAD_POST_API_KEY}
- OPENSHORTS_LOGO_URL=${OPENSHORTS_LOGO_URL:-https://openshorts.app/logo.png}
# Residential proxy for YouTube downloads (avoids datacenter-IP bans).
# e.g. http://user:pass@gate.dataimpulse.com:823 — leave empty to go direct.
- PROXY_URL=${PROXY_URL:-}
# PO-token provider (bgutil sidecar) → unlocks 720p/1080p downloads.
- BGUTIL_BASE_URL=${BGUTIL_BASE_URL:-http://bgutil:4416}
volumes:
pgdata: