services: gateway: build: context: . restart: unless-stopped init: true env_file: - .env environment: GATEWAY_HOST: 0.0.0.0 GATEWAY_PORT: 8190 KEY_DB_PATH: /data/keys.sqlite3 COMFYUI_UPSTREAM: ${COMFYUI_UPSTREAM:-http://host.docker.internal:8188} MAX_PROMPT_BODY_BYTES: ${MAX_PROMPT_BODY_BYTES:-2097152} UPSTREAM_TIMEOUT_SECONDS: ${UPSTREAM_TIMEOUT_SECONDS:-30} extra_hosts: - "host.docker.internal:host-gateway" ports: - "${GATEWAY_BIND_ADDRESS:-127.0.0.1}:${GATEWAY_PORT:-8190}:8190" volumes: - gateway_data:/data read_only: true tmpfs: - /tmp:size=16m,noexec,nosuid cap_drop: - ALL security_opt: - no-new-privileges:true healthcheck: test: ["CMD", "python", "-c", "import urllib.request; urllib.request.urlopen('http://127.0.0.1:8190/healthz', timeout=2)"] interval: 30s timeout: 3s retries: 3 start_period: 10s volumes: gateway_data: