Aller au contenu principal

Deployment Architecture

Last updated: February 2026

Platform​

Dokploy — a self-hosted deployment platform running on a VPS with Traefik as the reverse proxy for SSL termination, routing, and automatic HTTPS certificates.

Each application is configured as a separate Dokploy Application that builds from its Dockerfile directly from the Git repository on push to main.

Applications​

ApplicationDockerfileDomainBuild Strategy
APIapps/api/Dockerfileapi.emtb.consultingMulti-stage: builder → pruner → runner (Node Alpine)
Frontendapps/frontend/Dockerfileapp.emtb.consultingMulti-stage: deps → builder → Nginx Alpine
Docs Sitedocs-site/Dockerfiledocs.emtb.consultingDocusaurus static build → Nginx

Infrastructure​

ServiceProviderNotes
PostgreSQL 16Dokploy-managedAutomated backups, single instance
Redis 7Dokploy-managedAPI response caching
TraefikDokploy-managedReverse proxy, Let's Encrypt SSL
Object StorageS3/R2-compatibleDocument uploads (claim files)

Environments​

EnvironmentFrontendAPIPurpose
Developmentlocalhost:5173localhost:3001Local development (Vite dev server + NestJS watch mode)
Productionapp.emtb.consultingapi.emtb.consultingLive environment

Note: There is no staging environment. Production is the only deployed environment until after go-live.

Deployment Flow​

  1. Developer pushes to main branch
  2. Dokploy detects the push via watch paths
  3. Each application rebuilds independently using its Dockerfile
  4. Traefik routes traffic to the updated containers
  5. Database migrations run automatically on API startup (migrationsRun: true)

Docker Build Notes​

  • The monorepo root .dockerignore excludes e2e and docs-site contents but keeps their package.json files so yarn install --immutable can resolve all workspace dependencies.
  • All workspace package.json files must be COPYed into the Docker build context.
  • .yarn/releases/ and .yarnrc.yml are required for Yarn 4 to work inside Docker.
  • The frontend Dockerfile requires a VITE_API_URL build argument to bake in the API URL at build time.

Local Development with SSL​

For local development with HTTPS (matching production URLs):

  • Frontend: https://emtb.test/
  • API: https://api.emtb.test/

This uses a local SSL proxy (e.g., Caddy or mkcert) to serve the Vite and NestJS dev servers over HTTPS.