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
| Service | Image build | Internal port |
|---|---|---|
migrate | Same API prod image; node db/dist/migrate.js | — (one-shot) |
api | infrastructure/docker/api.Dockerfile (prod) | 3001 |
landing | infrastructure/docker/landing.Dockerfile (prod) | 3003 |
storefront | infrastructure/docker/storefront.Dockerfile (prod) | 3000 |
dashboard | infrastructure/docker/dashboard.Dockerfile (prod) | 8080 |
docs | infrastructure/docker/docs.Dockerfile (prod) | 3002 |
What is excluded from compose.deploy.yml
| Component | Managed by |
|---|---|
| PostgreSQL | Dokploy PostgreSQL service |
| Traefik | Dokploy platform (dokploy-traefik) |
| Dokploy itself | Host installation |
| MinIO | Not used in staging |
| Mail server | BYTEBITE-MAIL-01 |
Application services use expose: only — no public host port mappings.
Environment variables
Set in Dokploy (never commit). Key variables:
| Variable | Services | Purpose |
|---|---|---|
BYTEBITE_DEPLOY_ENV | api, landing, storefront, docs | staging enables noindex and the landing heading Coming Soon, Staging |
DATABASE_URL | migrate, api | PostgreSQL connection |
NODE_ENV | all | production |
API_INTERNAL_URL | storefront | http://api:3001 (default in compose) |
SENTRY_DSN | api | Error monitoring (optional) |
LOG_LEVEL | api | Log verbosity (default info) |
STAGING_BASIC_AUTH_USERS | compose interpolation (Traefik labels) | Staging HTTPS BasicAuth user:hash |
Full inventory: Secrets.
Deployment ordering
- Deploy — Dokploy builds images and starts the compose stack
- Migrate — the
migrateone-shot runsnode db/dist/migrate.js;apistarts only after exit 0 - Seed (fresh DB only, manual) —
node db/dist/seed-staging.js - 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
| Scenario | Approach |
|---|---|
| Bad application deploy | Redeploy previous Git commit via Dokploy |
| Bad migration | Restore database from off-host backup — see Disaster recovery — or fix forward + redeploy previous commit |
| Bad Traefik config | Restore 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.
Related
- Staging deployment — operational runbook
- Dokploy — project configuration
- Database — migrations and seeds
- Production deployment — not yet deployed