ByteBite Docs
Infrastructure

Platform Deployment

End-to-end deployment flow from GitHub to running containers.

Platform Deployment

ByteBite staging deploys automatically from GitHub through Dokploy. This page describes the platform-wide flow; environment-specific runbooks are in Deployment.

Deployment flow

GitHub (main branch, push)
  -> Dokploy webhook / On Push trigger
    -> Checkout to /etc/dokploy/compose/{project}/code/
      -> docker compose -f compose.deploy.yml build
        -> migrate one-shot (node db/dist/migrate.js)
          -> Start/restart containers (api, landing, storefront, dashboard, docs)
            -> Traefik routes traffic (Dokploy labels + compose labels)

What compose.deploy.yml deploys

ServiceImage buildInternal port
migrateSame API prod image; node db/dist/migrate.js— (one-shot)
apiinfrastructure/docker/api.Dockerfile (prod)3001
landinginfrastructure/docker/landing.Dockerfile (prod)3003
storefrontinfrastructure/docker/storefront.Dockerfile (prod)3000
dashboardinfrastructure/docker/dashboard.Dockerfile (prod)8080
docsinfrastructure/docker/docs.Dockerfile (prod)3002

What is excluded from compose.deploy.yml

ComponentManaged by
PostgreSQLDokploy PostgreSQL service
TraefikDokploy platform (dokploy-traefik)
Dokploy itselfHost installation
MinIONot used in staging
Mail serverBYTEBITE-MAIL-01

Application services use expose: only — no public host port mappings.

Environment variables

Set in Dokploy (never commit). Key variables:

VariableServicesPurpose
BYTEBITE_DEPLOY_ENVapi, landing, storefront, docsstaging enables noindex and the landing heading Coming Soon, Staging
DATABASE_URLmigrate, apiPostgreSQL connection
NODE_ENVallproduction
API_INTERNAL_URLstorefronthttp://api:3001 (default in compose)
SENTRY_DSNapiError monitoring (optional)
LOG_LEVELapiLog verbosity (default info)
STAGING_BASIC_AUTH_USERScompose interpolation (Traefik labels)Staging HTTPS BasicAuth user:hash

Full inventory: Secrets.

Deployment ordering

  1. Deploy — Dokploy builds images and starts the compose stack
  2. Migrate — the migrate one-shot runs node db/dist/migrate.js; api starts only after exit 0
  3. Seed (fresh DB only, manual) — node db/dist/seed-staging.js
  4. Validate — Validation smoke tests

The API process does not auto-migrate on startup. Seeds never run automatically. pnpm deploy:db:migrate remains a manual fallback.

Health checks

The migrate one-shot disables the API image healthcheck (no server listens). Docker HEALTHCHECK on API waits for GET /health. Storefront waits for API health via depends_on. Traefik routes only to healthy containers. migrate Exited (0) is success.

Rollback concepts

ScenarioApproach
Bad application deployRedeploy previous Git commit via Dokploy
Bad migrationRestore database from off-host backup — see Disaster recovery — or fix forward + redeploy previous commit
Bad Traefik configRestore from backup snapshots

Infrastructure services and deploy independence

Traefik DNS-01 wildcard wiring is host-level customization outside compose.deploy.yml. Application deploys do not modify Traefik static config. However, Dokploy platform upgrades may recreate Traefik — see Operations.

On this page