How we deploy VeloNuxt

Deploying VeloNuxt: Simplistic Scalability

VeloNuxt isn't just about development speed; it's about getting your SaaS to production with minimal friction. Our deployment strategy leverages Docker Swarm for orchestration and GitHub Actions for CI/CD, providing a robust yet simple path from commit to live.

The Architecture

At its core, VeloNuxt uses a Docker-based architecture designed for ease of use and scalability.

  • Docker Swarm: Handles service orchestration, ensuring your app stays up and scales as needed.

  • Caddy (Reverse Proxy): Automatically manages routing and SSL certificates.

  • MongoDB Replica Set: Provides a reliable database layer with oplog support for real-time features.

  • GitHub Container Registry (GHCR): Stores your private Docker images.

Prerequisites

Before you deploy, you'll need:

  1. A VPS: Any Ubuntu 22.04 server will do.

  2. Domain Name: Pointed to your VPS IP.

  3. GitHub Repository: Your VeloNuxt project hosted on GitHub.

Setting Up the Server

We keep the server setup manual minimal to avoid complex IaaC tools for early-stage projects.

  1. Create a Deploy User:

    bash
    adduser deploy
    usermod -aG docker deploy
  2. SSH Access: Add your local public key to .

The Deployment Pipeline

Our CI/CD pipeline is defined in . It automates the entire process:

  1. Build: Creates a Docker image from your code.

  2. Push: Uploads the image to GHCR.

  3. Deploy: SSHs into your VPS and updates the Docker Stack.

Configuration

You need to set a few secrets in your GitHub repository to make this magic happen:

  • DEPLOY_SSH_PRIVATE_KEY: The private key matching the public key you added to the user.

  • MONGO_URI: Your production MongoDB connection string.

  • JWT_SECRET: A secure random string for authentication.

Zero-Downtime Updates

Thanks to Docker Swarm's rolling updates, your users won't notice a thing when you push new code. The new container spins up and health-checks pass before the old one is taken down.

Monitoring

The stack includes basic health checks. You can extend this with tools like Portainer or Prometheus if you need deeper insights, but out of the box, gives you a quick snapshot of your system's health.


Ready to ship? Commit your changes and watch the pipeline go green!