mirror of
https://github.com/diegosouzapw/OmniRoute.git
synced 2026-07-26 09:52:11 +03:00
* feat: change default LIVE_WS_PORT from 20129 to 20132 Update the default WebSocket port for the live dashboard server from 20129 to 20132 across all configuration files, documentation, code comments, and tests. Also consolidate OMNIROUTE_DISABLE_LIVE_WS and OMNIROUTE_ENABLE_LIVE_WS into a single OMNIROUTE_ENABLE_LIVE_WS flag. Wire the live WebSocket server to start in-process via instrumentation-node.ts. * feat: clarify NEXT_PUBLIC_LIVE_WS_PUBLIC_URL path usage and derive upgrade path from URL Update .env.example and ENVIRONMENT.md to document that the pathname portion of NEXT_PUBLIC_LIVE_WS_PUBLIC_URL (e.g. /live-ws) is used as the WebSocket upgrade path by the dev proxy, handshake response, and client connection logic. Extract deriveLiveWsPath() into shared/utils/wsPath.ts and wire it through: - src/app/api/v1/ws/route.ts — handshake response path field - src/hooks/useLiveDashboard.ts — build * fix: use the standard URL API to safely parse and update the effectiveWsUrl * build(docker): expose live WebSocket server port and configure CORS origins Add LIVE_WS_PORT (20132), LIVE_WS_HOST (0.0.0.0), and LIVE_WS_ALLOWED_ORIGINS environment variables to all Docker Compose profiles and expose the WebSocket port mapping. Prevent infinite self-loop in standalone-server-ws.mjs by skipping proxy when the server itself is running on the LiveWS port. * docs(env): fix comment formatting for HOST and HOSTNAME variables --------- Co-authored-by: diegosouzapw <8016841+diegosouzapw@users.noreply.github.com>
85 lines
3.2 KiB
YAML
85 lines
3.2 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.2-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
|
|
build:
|
|
context: .
|
|
target: runner-cli
|
|
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:-0.0.0.0}
|
|
- 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:-0.0.0.0}
|
|
- HOSTNAME=0.0.0.0
|
|
- DATA_DIR=/app/data
|
|
ports:
|
|
- "${PROD_DASHBOARD_PORT:-20130}:${DASHBOARD_PORT:-${PORT:-20128}}"
|
|
- "${PROD_API_PORT:-20131}:${API_PORT:-20129}"
|
|
- "${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
|
|
|
|
volumes:
|
|
omniroute-prod-data:
|
|
name: omniroute-prod-data
|
|
redis-prod-data:
|
|
name: redis-prod-data
|