Skip to content

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

ServiceKindBuilt fromStartDomain
ikazebot-dbPostgrespgvector/pgvector:pg18noneinternal
ikazebot-redisRedis 8, password + AOFnonenoneinternal
ikazebot-apiApplicationikazebot-servernode dist/mainapi.ikazebot.com → 5000
ikazebot-workerApplicationikazebot-server (same commit)RAILPACK_START_CMD=node dist/worker.mainnone
ikazebot-webApplicationikazebot-webnext startapp.ikazebot.com → 3000

Without the worker, nothing in the background runs: no mail, crawls, exports, webhooks or rollups.

One-time setup

  1. Database: create it from pgvector/pgvector:pg18. As the superuser, CREATE EXTENSION vector, then create the ikazebot_app role 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.
  2. Redis with a password and persistence, internal only.
  3. Storage: a private Cloudflare R2 bucket whose CORS allows PUT from https://app.ikazebot.com.
  4. Mail: verify the sending domain in Resend (SPF and DKIM).
  5. DNS: app. and api. → the VPS.
  6. Secrets, generated once and kept in a password manager:
bash
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

  1. 1Merge to main
  2. 2Run new migrationsfrom your machine
  3. 3Deploy api + worker together
  4. 4Deploy webafter the API
  5. 5Check /health/ready
  1. Migrate before deploying code that needs the new schema, and keep migrations additive (see Migrations).
  2. Deploy ikazebot-api and ikazebot-worker together, from the same commit.
  3. Deploy ikazebot-web last, because the web app assumes the API's current contract.
  4. curl https://api.ikazebot.com/health/ready should return ok for 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.
Get started free — 50 credits a month