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​
| Application | Dockerfile | Domain | Build Strategy |
|---|---|---|---|
| API | apps/api/Dockerfile | api.emtb.consulting | Multi-stage: builder → pruner → runner (Node Alpine) |
| Frontend | apps/frontend/Dockerfile | app.emtb.consulting | Multi-stage: deps → builder → Nginx Alpine |
| Docs Site | docs-site/Dockerfile | docs.emtb.consulting | Docusaurus static build → Nginx |
Infrastructure​
| Service | Provider | Notes |
|---|---|---|
| PostgreSQL 16 | Dokploy-managed | Automated backups, single instance |
| Redis 7 | Dokploy-managed | API response caching |
| Traefik | Dokploy-managed | Reverse proxy, Let's Encrypt SSL |
| Object Storage | S3/R2-compatible | Document uploads (claim files) |
Environments​
| Environment | Frontend | API | Purpose |
|---|---|---|---|
| Development | localhost:5173 | localhost:3001 | Local development (Vite dev server + NestJS watch mode) |
| Production | app.emtb.consulting | api.emtb.consulting | Live environment |
Note: There is no staging environment. Production is the only deployed environment until after go-live.
Deployment Flow​
- Developer pushes to
mainbranch - Dokploy detects the push via watch paths
- Each application rebuilds independently using its Dockerfile
- Traefik routes traffic to the updated containers
- Database migrations run automatically on API startup (
migrationsRun: true)
Docker Build Notes​
- The monorepo root
.dockerignoreexcludes e2e and docs-site contents but keeps theirpackage.jsonfiles soyarn install --immutablecan resolve all workspace dependencies. - All workspace
package.jsonfiles must be COPYed into the Docker build context. .yarn/releases/and.yarnrc.ymlare required for Yarn 4 to work inside Docker.- The frontend Dockerfile requires a
VITE_API_URLbuild 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.