Deploying
The Dokploy runbook: services, environment, migrations and order of deploys.
On this page
Production is one Dokploy project on a single Hostinger VPS, with Traefik in front for TLS. Each app is a Dokploy Application that pulls from GitHub and builds with Railpack: no Dockerfile, no Compose. The full runbook is ikazebot-server/DEPLOY.md; this page is the map.
Services
| Service | Kind | Built from | Start | Domain |
|---|---|---|---|---|
ikazebot-db | Postgres | pgvector/pgvector:pg18 | none | internal |
ikazebot-redis | Redis 8, password + AOF | none | none | internal |
ikazebot-api | Application | ikazebot-server | node dist/main | api.ikazebot.com → 5000 |
ikazebot-worker | Application | ikazebot-server (same commit) | RAILPACK_START_CMD=node dist/worker.main | none |
ikazebot-web | Application | ikazebot-web | next start | app.ikazebot.com → 3000 |
Without the worker, nothing in the background runs: no mail, crawls, exports, webhooks or rollups.
One-time setup
- Database: create it from
pgvector/pgvector:pg18. As the superuser,CREATE EXTENSION vector, then create theikazebot_approle and its grants before the first migration (server README → "Database setup"). Turn on daily off-site backups, and restore one once to prove they work. - Redis with a password and persistence, internal only.
- Storage: a private Cloudflare R2 bucket whose CORS allows
PUTfromhttps://app.ikazebot.com. - Mail: verify the sending domain in Resend (SPF and DKIM).
- DNS:
app.andapi.→ the VPS. - Secrets, generated once and kept in a password manager:
openssl rand -base64 48 # AUTH_SECRET
openssl rand -hex 32 # WIDGET_RELAY_SECRET — same value in server and web
openssl rand -hex 32 # SECRETS_ENCRYPTION_KEY — losing it loses every stored secret
Environment
The api and worker get the same block (see DEPLOY.md §2 for every variable): NODE_ENV=production, TRUST_PROXY=true, DATABASE_URL as ikazebot_app, AUTH_COOKIE_DOMAIN=ikazebot.com, a non-:free EMBEDDING_MODEL, and so on. Never put the superuser URL in a deployed environment.
The web needs API_BASE_URL, NEXT_PUBLIC_API_URL and the same WIDGET_RELAY_SECRET. NEXT_PUBLIC_API_URL is inlined at build time, so changing it means redeploying.
Boot refuses :free models, the Resend test sender, and API and web hosts that differ without AUTH_COOKIE_DOMAIN. Without that variable, every sign-in would land back on the sign-in page.
Every deploy, in order
- 1Merge to main
- 2Run new migrationsfrom your machine
- 3Deploy api + worker together
- 4Deploy webafter the API
- 5Check /health/ready
- Migrate before deploying code that needs the new schema, and keep migrations additive (see Migrations).
- Deploy
ikazebot-apiandikazebot-workertogether, from the same commit. - Deploy
ikazebot-weblast, because the web app assumes the API's current contract. curl https://api.ikazebot.com/health/readyshould returnokfor the database, storage and queue.
Rollback: redeploy the previous commit, with api and worker together. Rolling back across a migration needs old code that tolerates the new schema, or a database restore.
First deploy: smoke test
Sign up and create a workspace, make yourself platform admin, and enable models at /admin/models. Then check, end to end: upload a PDF, ask in the playground, embed the widget on an allowed domain, take over from the Inbox, order a plan and approve it, and request an export. Finish with no failed jobs at /admin/queues.
Known limits of this setup
- One API replica. Some rate-limit counters are in memory; a second replica first needs them moved to Redis.
- With auto-deploy, the api and worker can briefly run different commits while one build finishes.
- No error tracking yet. Until Sentry and OpenTelemetry arrive, use Dokploy's logs (Pino JSON) and
/admin/queues, plus an external uptime check on/health/ready. - The VPS is a single point of failure, apart from R2 and the off-site backups.