deckhearth/docs/DOKPLOY_DEPLOY.md

90 lines
2.5 KiB
Markdown
Raw Normal View History

# Deck Hearth on Dokploy (CT 112)
Homelab deploy: Postgres + Redis + MinIO on CT 102, app on Dokploy, public URL via CT 100 Traefik → CT 112.
## 1. Prerequisites (CT 102)
- [x] `deckhearth` Postgres — `provision-deckhearth.sh`
- [x] MinIO bucket — `provision-deckhearth-minio.sh` (axiom-server)
- [ ] Neon data copy — `npm run migrate-neon-to-homelab` (optional)
## 2. Dokploy application
**Dashboard:** https://dokploy.stillwell.cloud
| Setting | Value |
| --- | --- |
| Source | Git (Forgejo/GitHub) → this repo |
| Build type | **Dockerfile** |
| Dockerfile path | `Dockerfile` (repo root — must be pushed to GitHub) |
| Branch | `main` (production) |
| Domain in Dokploy | `http://deckhearth.stillwell.cloud` (use `http://`, not `https://`) |
| Port | `3000` |
## 3. Environment variables (Dokploy → Environment)
```bash
# Database (CT 102)
POSTGRES_URL=postgresql://deckhearth:YOUR_PASSWORD@192.168.68.102:5432/deckhearth
# Redis rate limits (CT 102, DB index 5)
REDIS_URL=redis://:YOUR_REDIS_PASSWORD@192.168.68.102:6379/5
# MinIO object storage (CT 102)
S3_ENDPOINT=http://192.168.68.102:9000
S3_ACCESS_KEY_ID=deckhearth-app
S3_SECRET_ACCESS_KEY=YOUR_MINIO_SECRET
S3_BUCKET=deckhearth
S3_PUBLIC_BASE_URL=https://cdn.stillwell.cloud/deckhearth
S3_REGION=us-east-1
# Auth
JWT_SECRET=openssl rand -base64 32
# AI (kept on Vercel AI Gateway)
AI_GATEWAY_API_KEY=vck_…
# Email (external — Resend until self-hosted)
RESEND_API_KEY=re_…
# Cron (n8n on CT 105 hits this weekly)
CRON_SECRET=openssl rand -base64 24
# Optional
NODE_ENV=production
```
## 4. Traefik (CT 100)
Route added in `axiom-server/proxmox/ct100/traefik/config/dynamic/ct112-dokploy.yml`:
- Host: `deckhearth.stillwell.cloud`
- Backend: `http://192.168.68.112:80` (Dokploy Traefik)
After editing locally: `./proxmox/scripts/sync.sh push-traefik`
## 5. Catalog sync cron (replaces Vercel Cron)
Vercel `vercel.json` crons are removed. Schedule in **n8n** (CT 105) or cron:
```bash
curl -fsS -H "Authorization: Bearer $CRON_SECRET" \
https://deckhearth.stillwell.cloud/api/cron/sync-catalog
```
Weekly: `0 6 * * 1` (Mondays 06:00).
## 6. Decommission Vercel
1. Point DNS / AdGuard rewrite for `deckhearth.stillwell.cloud` at Traefik (already `*.stillwell.cloud` → CT 100).
2. Disable Vercel project auto-deploy or delete project after Coolify/Dokploy is stable.
3. Remove unused env vars from Vercel dashboard (Neon, Blob, Upstash).
## 7. Local dev
Same env vars in `.env.local` with homelab URLs (LAN required).
```bash
npm run dev
```