Docker Compose Deployment
Docker Compose Deployment
Docker Compose is the recommended deployment mode for self-hosting. It runs as two decoupled lightweight containers:
web: Serves pre-built static assets, listens onWEB_PORT(default8080), and reverse-proxies/api/*to the backend.api: Node.js backend listening onPORT(3001), hosting Gemini API proxies, third-party routes, and the Live WebSocket proxy.
Quickstart
# 1. Build production bundlespnpm run build:docker
# 2. Start containers in backgrounddocker compose up -d --buildAccess the UI at: http://localhost:8080.
Architecture & Optimizations
- Host Build Pipeline: The
webimage directly copies the host’s compileddist/, avoiding redundantnode_modulesdownloads inside Docker. - Dynamic Runtime Config (
runtime-config.js): On startup,docker/web-server.jsdynamically writes public environment variables intoruntime-config.js, enabling instant reconfiguration without rebuilding container images.
Useful Commands
# Follow logsdocker compose logs -f
# Stop containersdocker compose down
# Rebuild after pulling updatesgit pullpnpm run build:dockerdocker compose up -d --build