File size: 3,014 Bytes
cd8bd0a
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
# ──────────────────────────────────────────────────────────────────────
#  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}
      - 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}"
    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