feat: all-in-one production deployment with install script

Redesign deployment as a single docker-compose with Backspace, Caddy
(auto-HTTPS), and LiveKit (voice/video) using hybrid networking:
Backspace+Caddy on isolated bridge, LiveKit on host mode for WebRTC.

- Add install.sh: interactive installer that handles Docker setup,
  domain/DNS verification, secret generation, LiveKit config, and
  deployment with health-check wait
- Add Caddyfile: static reverse proxy config using Caddy env vars,
  routes /livekit/* to host-mode LiveKit via host.docker.internal
- Rewrite docker-compose.yml: all-in-one with profiles (voice),
  no external volumes/networks, bind mount ./data for visibility
- Fix livekit.ts: use LIVEKIT_URL env var directly instead of
  Host-header derivation that made the env var dead code
- Fix Dockerfile: health check reads $PORT dynamically
- Update .env.example: add DOMAIN, COMPOSE_PROFILES documentation
- Update .gitignore: add livekit.yaml (contains secrets)
This commit is contained in:
Jannis Braun
2026-03-03 19:51:51 +01:00
parent e37f9ea24c
commit 617999500b
7 changed files with 523 additions and 34 deletions
+3 -3
View File
@@ -75,9 +75,9 @@ ENV UPLOAD_DIR=/app/data/uploads
EXPOSE 3000
# Health check
HEALTHCHECK --interval=30s --timeout=5s --start-period=10s --retries=3 \
CMD node -e "fetch('http://localhost:3000/api/health').then(r => r.ok ? process.exit(0) : process.exit(1)).catch(() => process.exit(1))"
# Health check — reads PORT from environment so it works with any configured port
HEALTHCHECK --interval=30s --timeout=5s --start-period=30s --retries=5 \
CMD node -e "fetch('http://localhost:' + (process.env.PORT || 3000) + '/api/health').then(r => r.ok ? process.exit(0) : process.exit(1)).catch(() => process.exit(1))"
# Run the server using tsx from the server package directory
WORKDIR /app/packages/server