services: bridge: # Override BRIDGE_IMAGE to pull the published image from GHCR # (e.g. ghcr.io//openai-api-bridge:latest). Default builds # locally — convenient for dev, but a published image is the right choice # for the NAS deployment so you don't need a build toolchain there. image: ${BRIDGE_IMAGE:-openai-api-bridge:local} build: . container_name: openai-api-bridge ports: - "8080:8080" environment: # Required: bearer token clients must present. BRIDGE_API_KEY: ${BRIDGE_API_KEY:?BRIDGE_API_KEY is required} # Optional: secrets referenced from config.toml's *_env fields. VENICE_API_TOKEN: ${VENICE_API_TOKEN:-} LOG_LEVEL: ${LOG_LEVEL:-INFO} # Tuning RETENTION_DAYS: ${RETENTION_DAYS:-30} MAX_CACHE_GB: ${MAX_CACHE_GB:-50} MAX_CONCURRENT_VIDEO_JOBS: ${MAX_CONCURRENT_VIDEO_JOBS:-2} MAX_QUEUED_VIDEO_JOBS: ${MAX_QUEUED_VIDEO_JOBS:-20} VIDEO_JOB_TIMEOUT_SECONDS: ${VIDEO_JOB_TIMEOUT_SECONDS:-3600} # Per-provider budget for GET /v1/models. Listed explicitly because this # block is an allowlist, not env_file — a value set in .env alone would # never reach the container, and this is the knob that decides whether a # slow provider is omitted from a listing. MODELS_TIMEOUT_SECONDS: ${MODELS_TIMEOUT_SECONDS:-5} # Request-body ceiling and the unauthenticated docs routes. Listed for # the same reason as the knob above — this block is an allowlist, so a # value set only in .env never reaches the container. BRIDGE_MAX_REQUEST_MB: ${BRIDGE_MAX_REQUEST_MB:-100} BRIDGE_ENABLE_DOCS: ${BRIDGE_ENABLE_DOCS:-false} BRIDGE_PUBLIC_BASE_URL: ${BRIDGE_PUBLIC_BASE_URL:-} volumes: # Provider definitions. Bind-mount because they're hand-edited. - ./config.toml:/etc/openai-api-bridge/config.toml:ro # Persistent storage: SQLite + cached generated assets. Survives container # rebuilds; back this up if you want to preserve generated history. - bridge-state:/var/lib/openai-api-bridge # Workflows: bind-mount whatever path holds your ComfyUI workflow JSONs. # Edit the host-side path to match your setup; the container path must # match each `workflows_dir` in config.toml. - ${COMFYUI_WORKFLOWS_HOST_DIR:-./workflows}:/var/lib/openai-api-bridge/workflows:ro restart: unless-stopped volumes: bridge-state: