Files
memby/docker-compose.yml
T
2026-07-29 15:26:27 +12:00

102 lines
4.4 KiB
YAML

name: memby
services:
server:
build: ./server
restart: unless-stopped
ports:
# The NAS reverse proxy for https://mserver.sublogue.com targets this fixed
# port. Keep host and container on 32768 so Docker's published mapping and
# the process listener cannot drift apart.
- "${MEMBY_PORT:-32768}:32768"
environment:
MEMBY_LISTEN_ADDR: ":32768"
# INFO keeps Docker logs concise. Temporarily use DEBUG to include successful
# health checks, maintenance polling and artwork requests.
MEMBY_LOG_LEVEL: "${MEMBY_LOG_LEVEL:-INFO}"
# Local day boundaries and schedule labels for Sonarr's "airing today" row.
MEMBY_TIMEZONE: "${MEMBY_TIMEZONE:-Pacific/Auckland}"
# How the gateway reaches Emby.
MEMBY_EMBY_URL: "${MEMBY_EMBY_URL:?set MEMBY_EMBY_URL in .env}"
# What the TVs are told to stream from. Only set this when it differs from the
# address above (video goes device -> Emby directly, never through the gateway).
MEMBY_EMBY_PUBLIC_URL: "${MEMBY_EMBY_PUBLIC_URL:-}"
MEMBY_DATABASE_URL: "postgres://memby:${POSTGRES_PASSWORD:?set POSTGRES_PASSWORD in .env}@postgres:5432/memby?sslmode=disable"
MEMBY_REDIS_URL: "redis://redis:6379/0"
MEMBY_HOME_TTL: "${MEMBY_HOME_TTL:-60s}"
# Strict per-Emby-user TV allowance. Signing the same physical TV in again
# replaces its token and does not consume another slot.
MEMBY_MAX_CLIENTS_PER_USER: "${MEMBY_MAX_CLIENTS_PER_USER:-1}"
# Unset disables /admin entirely — the library import, maintenance switch and
# analytics page all live behind it.
MEMBY_ADMIN_TOKEN: "${MEMBY_ADMIN_TOKEN:-}"
# CI publishes signed APKs here. The dedicated token does not grant access to the
# rest of the admin API.
MEMBY_PUBLIC_URL: "${MEMBY_PUBLIC_URL:-https://mserver.sublogue.com}"
MEMBY_RELEASE_DIR: "/data/releases"
MEMBY_RELEASE_PUBLISH_TOKEN: "${MEMBY_RELEASE_PUBLISH_TOKEN:-}"
# Hourly incremental import: enough for episodes landing through the day, and
# films appearing weekly ride along.
MEMBY_SYNC_INTERVAL: "${MEMBY_SYNC_INTERVAL:-1h}"
MEMBY_SYNC_ON_START: "${MEMBY_SYNC_ON_START:-false}"
MEMBY_SYNC_USER_ID: "${MEMBY_SYNC_USER_ID:-}"
MEMBY_SYNC_API_KEY: "${MEMBY_SYNC_API_KEY:-}"
# Optional read-only Sonarr calendar integration. Both values are required to
# enable it; the API key remains inside the gateway.
MEMBY_SONARR_URL: "${MEMBY_SONARR_URL:-}"
MEMBY_SONARR_API_KEY: "${MEMBY_SONARR_API_KEY:-}"
MEMBY_SONARR_TTL: "${MEMBY_SONARR_TTL:-5m}"
# Optional Tracearr public API. Memby reads recent playback analytics to rank
# the dedicated For You area; the token never leaves this container.
MEMBY_TRACEARR_URL: "${MEMBY_TRACEARR_URL:-}"
MEMBY_TRACEARR_API_KEY: "${MEMBY_TRACEARR_API_KEY:-}"
MEMBY_TRACEARR_SERVER_ID: "${MEMBY_TRACEARR_SERVER_ID:-}"
MEMBY_TRACEARR_SYNC_INTERVAL: "${MEMBY_TRACEARR_SYNC_INTERVAL:-5m}"
MEMBY_TRACEARR_FULL_INTERVAL: "${MEMBY_TRACEARR_FULL_INTERVAL:-24h}"
MEMBY_FOR_YOU_MIN_REBUILD_AGE: "${MEMBY_FOR_YOU_MIN_REBUILD_AGE:-10m}"
MEMBY_FOR_YOU_REFRESH_INTERVAL: "${MEMBY_FOR_YOU_REFRESH_INTERVAL:-30m}"
volumes:
- memby-releases:/data/releases
depends_on:
postgres:
condition: service_healthy
redis:
condition: service_healthy
healthcheck:
# No shell or curl in a distroless image, so probe with the binary's own server
# via the container's TCP port from the Docker healthcheck's perspective.
test: ["CMD", "/app/memby-server", "-healthcheck"]
interval: 30s
timeout: 5s
retries: 3
start_period: 10s
postgres:
image: postgres:17-alpine
restart: unless-stopped
environment:
POSTGRES_USER: memby
POSTGRES_PASSWORD: "${POSTGRES_PASSWORD:?set POSTGRES_PASSWORD in .env}"
POSTGRES_DB: memby
volumes:
- memby-postgres:/var/lib/postgresql/data
healthcheck:
test: ["CMD-SHELL", "pg_isready -U memby -d memby"]
interval: 10s
timeout: 5s
retries: 5
redis:
image: redis:7-alpine
restart: unless-stopped
command: ["redis-server", "--save", "", "--appendonly", "no", "--maxmemory", "256mb", "--maxmemory-policy", "allkeys-lru"]
healthcheck:
test: ["CMD", "redis-cli", "ping"]
interval: 10s
timeout: 5s
retries: 5
volumes:
memby-postgres:
memby-releases: