services:
  olcrtc-server:
    build:
      context: .
    image: olcrtc/server:local
    container_name: olcrtc-server
    restart: unless-stopped
    environment:
      OLCRTC_MODE: srv
      OLCRTC_CARRIER: "${OLCRTC_CARRIER:?set OLCRTC_CARRIER (jitsi, telemost, wbstream, none)}"
      OLCRTC_TRANSPORT: "${OLCRTC_TRANSPORT:-datachannel}"
      OLCRTC_ROOM_ID: "${OLCRTC_ROOM_ID:-}"
      OLCRTC_KEY: "${OLCRTC_KEY:-}"
      OLCRTC_KEY_FILE: "${OLCRTC_KEY_FILE:-/var/lib/olcrtc/key.hex}"
      OLCRTC_DNS: "${OLCRTC_DNS:-8.8.8.8:53}"
      OLCRTC_SOCKS_PROXY: "${OLCRTC_SOCKS_PROXY:-}"
      OLCRTC_SOCKS_PROXY_PORT: "${OLCRTC_SOCKS_PROXY_PORT:-1080}"
      OLCRTC_VIDEO_W: "${OLCRTC_VIDEO_W:-0}"
      OLCRTC_VIDEO_H: "${OLCRTC_VIDEO_H:-0}"
      OLCRTC_VIDEO_FPS: "${OLCRTC_VIDEO_FPS:-0}"
      OLCRTC_VIDEO_BITRATE: "${OLCRTC_VIDEO_BITRATE:-}"
      OLCRTC_VIDEO_HW: "${OLCRTC_VIDEO_HW:-none}"
      OLCRTC_VIDEO_CODEC: "${OLCRTC_VIDEO_CODEC:-qrcode}"
      OLCRTC_VIDEO_QR_SIZE: "${OLCRTC_VIDEO_QR_SIZE:-0}"
      OLCRTC_VIDEO_QR_RECOVERY: "${OLCRTC_VIDEO_QR_RECOVERY:-low}"
      OLCRTC_VIDEO_TILE_MODULE: "${OLCRTC_VIDEO_TILE_MODULE:-0}"
      OLCRTC_VIDEO_TILE_RS: "${OLCRTC_VIDEO_TILE_RS:-0}"
      OLCRTC_VP8_FPS: "${OLCRTC_VP8_FPS:-0}"
      OLCRTC_VP8_BATCH: "${OLCRTC_VP8_BATCH:-0}"
      OLCRTC_SEI_FPS: "${OLCRTC_SEI_FPS:-0}"
      OLCRTC_SEI_BATCH: "${OLCRTC_SEI_BATCH:-0}"
      OLCRTC_SEI_FRAG: "${OLCRTC_SEI_FRAG:-0}"
      OLCRTC_SEI_ACK: "${OLCRTC_SEI_ACK:-0}"
      OLCRTC_DEBUG: "${OLCRTC_DEBUG:-false}"
    volumes:
      - olcrtc-state:/var/lib/olcrtc
    init: true

volumes:
  olcrtc-state:
