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

  1. In Dokploy, create a new application
  2. Set source to Docker (GitHub Container Registry)
  3. 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=prod
  • DATABASE_URL — pointing to the Dokploy PostgreSQL instance
  • CORS_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

  1. Create another application in Dokploy
  2. Set source to Docker (GitHub Container Registry)
  3. 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:

  1. Copy the webhook URL from application settings
  2. Add it as a GitHub secret (DOKPLOY_WEBHOOK_URL) in the respective repository
  3. Pushes to main will now automatically build and deploy

Step 5: Configure Stripe Webhook

In the Stripe Dashboard:

  1. Go to Developers → Webhooks
  2. Add endpoint: https://api.yourdomain.com/api/v1/webhooks/stripe
  3. Select the 5 required events
  4. Copy the signing secret to the backend's STRIPE_WEBHOOK_SECRET

DNS Configuration

RecordDomainTarget
Ayourdomain.comYour server IP
Aapi.yourdomain.comYour server IP

Dokploy handles HTTPS certificates automatically via Let's Encrypt.