Production Deployment
Step-by-step production deployment with Dokploy
Production Deployment
This guide covers deploying both the backend and frontend to production using Dokploy.
Prerequisites
- A server (VPS) with Dokploy installed
- Two domain names (or subdomains): one for the frontend, one for the backend API
- GitHub repositories for both projects with CI/CD configured
Step 1: Set Up Dokploy
Dokploy is a self-hosted deployment platform. Install it on your server:
curl -sSL https://dokploy.com/install.sh | sh
Access the Dokploy dashboard at https://your-server-ip:3000.
Step 2: Deploy the Backend
Create Application
- In Dokploy, create a new application
- Set source to Docker (GitHub Container Registry)
- Image:
ghcr.io/{owner}/go-mvp-backend:main
Create Database
Use the built-in CLI command or create a PostgreSQL database manually in Dokploy.
Configure Environment
Set all backend environment variables (see Backend Deployment for the complete list).
Key variables to set:
APP_ENV=prodDATABASE_URL— pointing to the Dokploy PostgreSQL instanceCORS_ALLOW_ORIGIN— matching your frontend domain- Stripe, Firebase, Brevo credentials
- Frontend redirect URLs
Mount JWT Keys
Mount private.pem and public.pem as file volumes in Dokploy.
Set Domain
Configure your API domain (e.g., api.yourdomain.com) with HTTPS.
Initial Setup
After first deployment:
bin/console doctrine:migrations:migrate --no-interaction
bin/console app:stripe:sync-plans
bin/console app:user:promote-admin admin@yourdomain.com
Step 3: Deploy the Frontend
Create Application
- Create another application in Dokploy
- Set source to Docker (GitHub Container Registry)
- Image:
ghcr.io/{owner}/go-mvp-frontend:main
Configure Environment
NUXT_PUBLIC_API_BASE_URL=https://api.yourdomain.com
NUXT_PUBLIC_FIREBASE_API_KEY=your-key
NUXT_PUBLIC_FIREBASE_AUTH_DOMAIN=your-project.firebaseapp.com
NUXT_PUBLIC_FIREBASE_PROJECT_ID=your-project-id
Set Domain
Configure your frontend domain (e.g., yourdomain.com) with HTTPS.
Step 4: Configure Webhooks
For each application in Dokploy:
- Copy the webhook URL from application settings
- Add it as a GitHub secret (
DOKPLOY_WEBHOOK_URL) in the respective repository - Pushes to
mainwill now automatically build and deploy
Step 5: Configure Stripe Webhook
In the Stripe Dashboard:
- Go to Developers → Webhooks
- Add endpoint:
https://api.yourdomain.com/api/v1/webhooks/stripe - Select the 5 required events
- Copy the signing secret to the backend's
STRIPE_WEBHOOK_SECRET
DNS Configuration
| Record | Domain | Target |
|---|---|---|
| A | yourdomain.com | Your server IP |
| A | api.yourdomain.com | Your server IP |
Dokploy handles HTTPS certificates automatically via Let's Encrypt.