# Emby Watch Party 2.0 -- docker-compose example # # Two volume mounts are required for avatars to survive container # restarts (new in 2.0): /app/data holds the SQLite avatar DB, # /app/images/avatars holds the uploaded image files. Without them # every restart wipes every member's chosen avatar. # # `version:` is omitted intentionally -- modern Docker Compose v2 # ignores it and warns on its presence. services: emby-watchparty: # Recommended: pull the pre-built multi-arch image from GHCR. # `:latest` tracks the latest stable, `:devel` / `:nightly` tracks # the current closed-beta build, and `:2.0.0-betaN` pins a # specific beta. Comment this line and uncomment `build: .` below # to build from local source instead. image: ghcr.io/oratorian/emby-watchparty:latest # build: . container_name: emby-watchparty # Map the container port to the host. Bump the right-hand side if # WATCH_PARTY_PORT is changed in .env (or in the environment # overrides below); both sides must match the configured port. ports: - "5000:5000" # Load boot-essential config from .env (created from .env.example). # All mutable runtime settings live in config.json (mounted below) # and are edited via /admin -- they are NOT environment overrides. env_file: - .env # Uncomment to override .env values without touching the file # (e.g. driven by an external secrets store). Only the boot # values from .env.example belong here; everything else is in # config.json via /admin. # environment: # - WATCH_PARTY_BIND=0.0.0.0 # - WATCH_PARTY_PORT=5000 # - SESSION_EXPIRY=86400 # - APP_PREFIX=/watchparty # - EMBY_SERVER_URL=http://your-emby-server:8096 # - EMBY_API_KEY=your_api_key_here # # Session cookie hardening (new in 2.0.0-beta18). See # # .env.example for detailed notes. Generate SESSION_SECRET # # ONCE with `openssl rand -hex 32` -- an ephemeral fallback # # is used if empty, which kicks every user out on every # # restart. Turn SESSION_COOKIE_SECURE=true for HTTPS # # deployments. CORS_ALLOWED_ORIGINS pins the Socket.IO # # origin allowlist (default `*` for backwards compat). # - SESSION_SECRET=change-me-openssl-rand-hex-32 # - SESSION_COOKIE_SECURE=true # - CORS_ALLOWED_ORIGINS=https://watchparty.example.com volumes: # Required: persist avatars across restarts. ./data and ./images # are created next to this compose file on first run. - ./data:/app/data # SQLite avatar DB (avatars.db) - ./images/avatars:/app/images/avatars # uploaded avatar images # Optional: persist application logs to the host (only useful if # LOG_TO_FILE is enabled via /admin; default is console only). - ./logs:/app/logs # Optional: persist the runtime admin config across container # rebuilds. Without this mount, changes made via /admin survive # restarts of the same container but are wiped if the container # is recreated. IMPORTANT: `touch config.json` on the host BEFORE # the first `docker compose up`, otherwise Docker silently # creates `config.json` as an empty directory and the backend # fails to write its settings. - ./config.json:/app/config.json # The Dockerfile already bakes a HEALTHCHECK that hits /api/health # via the configured WATCH_PARTY_PORT, so an explicit healthcheck # block here is not required. Uncomment to tighten the cadence: # healthcheck: # test: ["CMD", "wget", "-q", "--spider", "http://localhost:5000/api/health"] # interval: 30s # timeout: 5s # retries: 3 restart: unless-stopped networks: - emby-network networks: emby-network: driver: bridge