mirror of
https://github.com/Routstr/routstr-core.git
synced 2026-08-12 04:03:21 +00:00
- Add nginx reverse proxy service with health checks - Add 2 replicas for routstr service with healthchecks - Modify auto_update.sh to use rolling updates (--build without down)
72 lines
1.7 KiB
YAML
72 lines
1.7 KiB
YAML
services:
|
|
nginx:
|
|
image: nginx:latest
|
|
ports:
|
|
- 80:80
|
|
- 443:443
|
|
volumes:
|
|
- ./nginx.conf:/etc/nginx/nginx.conf:ro
|
|
depends_on:
|
|
routstr:
|
|
condition: service_healthy
|
|
healthcheck:
|
|
test: ["CMD", "wget", "-q", "--spider", "http://localhost/health"]
|
|
interval: 30s
|
|
timeout: 10s
|
|
retries: 3
|
|
start_period: 10s
|
|
|
|
ui:
|
|
env_file:
|
|
- .env
|
|
build:
|
|
context: ./ui
|
|
dockerfile: Dockerfile.build
|
|
args:
|
|
# NEXT_PUBLIC_API_URL: ${NEXT_PUBLIC_API_URL:-http://127.0.0.1:8000}
|
|
NEXT_PUBLIC_ADMIN_API_KEY: ${NEXT_PUBLIC_ADMIN_API_KEY:-}
|
|
volumes:
|
|
- ./ui_out:/output
|
|
command:
|
|
["sh", "-c", "mkdir -p /output && cp -r /app/built/. /output/ && echo 'UI build copied to mounted volume' && ls -la /output/ && echo 'UI built and ready' && tail -f /dev/null"]
|
|
|
|
routstr:
|
|
build: .
|
|
deploy:
|
|
replicas: 2
|
|
depends_on:
|
|
- ui
|
|
- nginx
|
|
volumes:
|
|
- .:/app
|
|
- ./logs:/app/logs
|
|
- tor-data:/var/lib/tor:ro
|
|
- ./ui_out:/app/ui_out:ro
|
|
env_file:
|
|
- .env
|
|
environment:
|
|
- TOR_PROXY_URL=socks5://tor:9050
|
|
ports:
|
|
- 8000:8000
|
|
extra_hosts: # Needed to access locally running models
|
|
- "host.docker.internal:host-gateway"
|
|
healthcheck:
|
|
test: ["CMD", "curl", "-f", "http://localhost:8000/health"]
|
|
interval: 30s
|
|
timeout: 10s
|
|
retries: 3
|
|
start_period: 40s
|
|
|
|
tor:
|
|
image: ghcr.io/hundehausen/tor-hidden-service:latest
|
|
volumes:
|
|
- tor-data:/var/lib/tor
|
|
environment:
|
|
# Format: HS_<NAME>=<TARGET_HOST>:<TARGET_PORT>:<VIRTUAL_PORT>
|
|
- HS_ROUTER=routstr:8000:80
|
|
depends_on:
|
|
- routstr
|
|
|
|
volumes:
|
|
tor-data:
|