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
        -> Start/restart containers (api, storefront, dashboard, docs)
          -> Traefik routes traffic (Dokploy labels + compose labels)

What compose.deploy.yml deploys

ServiceImage buildInternal port
apiinfrastructure/docker/api.Dockerfile (prod)3001
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, storefront, docsstaging enables noindex
DATABASE_URLapiPostgreSQL connection
NODE_ENVallproduction
API_INTERNAL_URLstorefronthttp://api:3001 (default in compose)
SENTRY_DSNapiError monitoring (optional)
LOG_LEVELapiLog verbosity (default info)

Full inventory: Secrets.

Deployment ordering

After a deploy that includes schema changes:

  1. Deploy — Dokploy builds and starts containers
  2. Migratenode db/dist/migrate.js (once, in api container)
  3. Seed (fresh DB only) — node db/dist/seed-staging.js
  4. ValidateValidation smoke tests

Migrations do not run on API startup.

Health checks

Docker HEALTHCHECK on API waits for GET /health. Storefront waits for API health via depends_on. Traefik routes only to healthy containers.

Rollback concepts

ScenarioApproach
Bad application deployRedeploy previous Git commit via Dokploy
Bad migrationRestore database from backup (no backup strategy yet — see Known gaps) + 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