1.4 KiB
1.4 KiB
Dokploy Deployment
Assumptions
- Frontend: React Vite SPA built with Bun, served by nginx. Single public entry point.
- Backend: FastAPI, internal only. No Traefik labels, no public ports.
- Routing: nginx proxies
/apito backend. Traefik routes all traffic to frontend (port 80). - Domain: Replace
your-domain.comin Traefik labels with your actual domain.
Build & Run Locally
# Create network (Dokploy provides this)
docker network create dokploy-network 2>/dev/null || true
# Build and run
docker compose up --build
Frontend will be on port 80 (or the mapped port). Backend is internal.
Dokploy Setup
-
Create
dokploy-networkif not exists:docker network create dokploy-network -
Deploy via Dokploy UI: add project, use this
docker-compose.yml. -
Set environment variables in Dokploy:
CORS_ORIGINS: Comma-separated allowed origins (e.g.https://your-domain.com)
-
Update Traefik labels in
docker-compose.yml:- Replace
your-domain.comwith your domain - Ensure
certResolver=letsencryptmatches your Traefik config
- Replace
Port Rules
- Frontend: Exposes port 80 internally. Traefik routes to it.
- Backend: No ports exposed. Communicates via
dokploy-network.
Service Communication
- Frontend (nginx) proxies
/apitohttp://backend:8000 - Backend is reachable only from within the Docker network