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
| Service | Image build | Internal port |
|---|---|---|
api | infrastructure/docker/api.Dockerfile (prod) | 3001 |
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, storefront, docs | staging enables noindex |
DATABASE_URL | 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) |
Full inventory: Secrets.
Deployment ordering
After a deploy that includes schema changes:
- Deploy — Dokploy builds and starts containers
- Migrate —
node db/dist/migrate.js(once, in api container) - Seed (fresh DB only) —
node db/dist/seed-staging.js - Validate — Validation 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
| Scenario | Approach |
|---|---|
| Bad application deploy | Redeploy previous Git commit via Dokploy |
| Bad migration | Restore database from backup (no backup strategy yet — see Known gaps) + 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