Files
OmniRoute/docker-compose.prod.yml
Diego Rodrigues de Sa e Souza 57a37ed858 fix(docker): bind app/sidecar compose ports to loopback by default (#12568, #12578) (#13240)
Merged as part of the 39-PR owner batch of 2026-09-11, validated as a unit.

Boarded into one consolidated worktree cut from `release/v3.8.51` with the other 38 — zero conflicts between them.

- ESLint over every changed file: no errors (the only finding was one suppression entry the batch emptied, pruned on #13243)
- `typecheck:core` clean; `check:dashboard-typecheck` OK (206 pre-existing, within baseline); `check:changelog-integrity` OK
- complexity 2821 / baseline 3218 and cognitive-complexity 1272 / baseline 1437 — both under baseline
- 256 assertions green: 246 under node:test and 10 under vitest, which is where `tests/unit/**/*.test.tsx` actually runs
- `check-file-size`: `chatCore.ts` rebaselined 6144 → 6146 for #13278 and #13276, annotated and landed on #13243

⚠️ base-red inherited: #12732 — the provider count (356 in the docs vs the 358 the modules define) and `open-sse/utils/stream.ts` at 3115 > frozen 3098 both reproduce on the pure tip with zero contribution from this batch.
2026-09-11 22:05:14 -03:00

108 lines
4.4 KiB
YAML

# ──────────────────────────────────────────────────────────────────────
# OmniRoute — Docker Compose (Production Snapshot)
# ──────────────────────────────────────────────────────────────────────
#
# Isolated production instance running on port 20130.
# Keeps the app running while you continue developing locally.
#
# Usage:
# docker compose -f docker-compose.prod.yml up -d --build
# docker compose -f docker-compose.prod.yml down
# docker compose -f docker-compose.prod.yml logs -f
#
# Image flavors (two Dockerfile stages):
# runner-base (default / omniroute:prod)
# Lean image — no Playwright/Chromium. Suitable for all providers
# except web-cookie ones (gemini-web, claude-web, claude-turnstile).
#
# runner-web (omniroute:prod-web) — opt-in, ~300 MB extra
# Includes Playwright + Chromium system libs. Required for web-cookie
# providers. To use this flavor, override the build target:
#
# omniroute-prod:
# build:
# context: .
# target: runner-web
# image: omniroute:prod-web
# ──────────────────────────────────────────────────────────────────────
services:
# ── Redis (Rate Limiter Backend) ──────────────────────────────────
redis:
image: redis:8.6.5-alpine
container_name: omniroute-redis-prod
restart: unless-stopped
volumes:
- redis-prod-data:/data
command: redis-server --save 60 1 --loglevel warning
healthcheck:
test: ["CMD", "redis-cli", "ping"]
interval: 10s
timeout: 5s
retries: 3
omniroute-prod:
container_name: omniroute-prod
depends_on:
redis:
condition: service_healthy
chatgpt-web-codex-browser:
condition: service_started
build:
context: .
target: runner-cli
args:
OMNIROUTE_BASE_PATH: ${OMNIROUTE_BASE_PATH:-}
image: omniroute:prod
restart: unless-stopped
stop_grace_period: 40s
env_file: .env
environment:
- NODE_ENV=production
- PORT=${PORT:-20128}
- DASHBOARD_PORT=${DASHBOARD_PORT:-${PORT:-20128}}
- API_PORT=${API_PORT:-20129}
- LIVE_WS_PORT=${LIVE_WS_PORT:-20132}
- LIVE_WS_HOST=${LIVE_WS_HOST:-127.0.0.1}
- LIVE_WS_ALLOWED_ORIGINS=${LIVE_WS_ALLOWED_ORIGINS:-http://localhost:${PROD_DASHBOARD_PORT:-20130},http://127.0.0.1:${PROD_DASHBOARD_PORT:-20130}}
- API_HOST=${API_HOST:-127.0.0.1}
# HOSTNAME intentionally not hardcoded to 0.0.0.0 (#12568) — let the
# app's own loopback-first default apply unless the operator sets it.
- DATA_DIR=/app/data
- OMNIROUTE_BASE_PATH=${OMNIROUTE_BASE_PATH:-}
- CHATGPT_WEB_CODEX_CDP_URL=http://chatgpt-web-codex-browser:9223
ports:
# Loopback-only by default (#12568) — see docker-compose.yml's
# APP_BIND_HOST comment for the rationale. Override for a LAN/WAN prod
# deployment only once REQUIRE_API_KEY=true or a reverse proxy in front
# of this instance is confirmed to enforce its own auth.
- "${APP_BIND_HOST:-127.0.0.1}:${PROD_DASHBOARD_PORT:-20130}:${DASHBOARD_PORT:-${PORT:-20128}}"
- "${APP_BIND_HOST:-127.0.0.1}:${PROD_API_PORT:-20131}:${API_PORT:-20129}"
- "${APP_BIND_HOST:-127.0.0.1}:${PROD_LIVE_WS_PORT:-20132}:${LIVE_WS_PORT:-20132}"
volumes:
- omniroute-prod-data:/app/data
healthcheck:
test: ["CMD", "node", "healthcheck.mjs"]
interval: 30s
timeout: 5s
retries: 3
start_period: 15s
chatgpt-web-codex-browser:
build:
context: .
dockerfile: docker/chatgpt-web-codex-browser/Dockerfile
image: omniroute:chatgpt-web-codex-browser
restart: unless-stopped
shm_size: "2gb"
volumes:
- chatgpt-web-codex-browser-prod-data:/browser-profile
volumes:
chatgpt-web-codex-browser-prod-data:
name: omniroute-chatgpt-web-codex-browser-prod-data
omniroute-prod-data:
name: omniroute-prod-data
redis-prod-data:
name: redis-prod-data