Skip to content

feat(deploy): production Docker + Caddy stack for OpenRouter#1

Draft
NabilRFG12 wants to merge 1 commit into
mainfrom
claude/serene-brown-zVa19
Draft

feat(deploy): production Docker + Caddy stack for OpenRouter#1
NabilRFG12 wants to merge 1 commit into
mainfrom
claude/serene-brown-zVa19

Conversation

@NabilRFG12

Copy link
Copy Markdown
Owner

Summary

Adds a turnkey self-hosted deployment path for a VPS, using OpenRouter as the LLM provider.

  • docker-compose.prod.yml — runs the app behind Caddy with automatic Let's Encrypt HTTPS; app is not exposed directly (only :80/:443 via Caddy), with a healthcheck on /api/health and persistent volumes for app data + Caddy certs.
  • Caddyfile — reverse-proxies to openmaic:3000, reads {$DOMAIN} / {$ACME_EMAIL} from env; streams SSE (e.g. /api/chat) and uses no proxy timeouts so long generations (maxDuration = 300) aren't cut off.
  • .env.openrouter.example — OpenRouter-focused template (OPENROUTER_API_KEY, OPENROUTER_MODELS, DEFAULT_MODEL=openrouter:…, ACCESS_CODE, DOMAIN, ACME_EMAIL) with commented-out TTS/image/video slots.
  • .gitignore — track the new .env.openrouter.example (mirrors the existing !.env.example exception).

Notes

  • OPENROUTER_MODELS replaces the 2 built-in OpenRouter entries; the Settings UI surfaces any listed slug as selectable (lib/store/settings.ts fetchServerProviders), and the key stays server-side (isServerConfigured).
  • OpenRouter is LLM-only; without a TTS/image provider the app degrades gracefully (browser Web Speech voice, no generated slide images).
  • The build compiles native deps (sharp, @napi-rs/canvas) — needs ~2GB+ RAM.
  • No real secrets committed — placeholders only.

Test plan

  • cp .env.openrouter.example .env.local; set DOMAIN, ACME_EMAIL, OPENROUTER_API_KEY, ACCESS_CODE
  • docker compose -f docker-compose.prod.yml up --build -d on a VPS with a domain + ports 80/443 open
  • Caddy obtains a valid TLS cert; site loads over HTTPS and prompts for the access code
  • In Settings, OpenRouter shows as server-configured with the OPENROUTER_MODELS list selectable
  • Generate a classroom end-to-end (outline → scenes); confirm playback + a discussion (SSE) works through the proxy
  • HTTP-only fallback: set DOMAIN=:80 and confirm the app serves without a cert

https://claude.ai/code/session_01TnEDwUuc2k9PvgRmHLGrfB


Generated by Claude Code

Adds a turnkey VPS deployment path: docker-compose.prod.yml runs the app
behind Caddy with automatic HTTPS, an OpenRouter-focused .env template, and
a Caddyfile that streams SSE and avoids proxy timeouts on long generations.

https://claude.ai/code/session_01TnEDwUuc2k9PvgRmHLGrfB
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants