Skip to content

To The Cloud

This guide shows you how to deploy your BlazorSaas app to Coolify. It uses the setup-prod Nuke target to configure production settings and Docker, then pushes to your repository for deployment.

Prerequisites

Ensure these are ready before starting:

  • A Coolify instance with a webhook URL.
  • A Docker registry account (e.g., GitHub Container Registry at ghcr.io).
  • Your app’s repository set up with an origin remote.

Configure Production Settings

Prepare your app for production with the setup-prod Nuke target.

Run:

Terminal window
nuke setup-prod

This target prompts you for:

  • Docker Registry: Enter your registry (default: ghcr.io).
  • Docker Repository: Enter your repo name (default: your project name in lowercase).
  • Coolify Webhook: Provide the webhook URL from your Coolify instance.

It updates build.parameters.json, docker-compose.yml, and app settings files with these values.

Review Docker Compose

Verify your docker-compose.yml after setup-prod.

It should resemble:

services:
api:
image: '{blazor_saas:docker_registry}/{blazor_saas:docker_repository}/api:latest'
depends_on:
migrations:
condition: service_completed_successfully
volumes:
- app_data:/data
environment:
- SERVICE_FQDN_API_8080
- 'DATAPATH=${DATAPATH}'
- 'CONNECTIONSTRINGS__DATABASE=${CONNECTION_STRING}'
- 'CONNECTIONSTRINGS__CACHE=${CONNECTIONSTRING_REDIS}'
- 'ADMIN__DEFAULTEMAIL=${DEFAULT_ADMIN_EMAIL}'
- 'ADMIN__DEFAULTPASSWORD=${DEFAULT_ADMIN_PASSWORD}'
- 'STRIPE__APIKEY=${STRIPE_APIKEY}'
- 'STRIPE__WEBHOOKSIGNATURE=${STRIPE_WEBHOOKSIGNATURE}'
- 'EMAIL__APIKEY=${EMAIL_APIKEY}'
- 'TURNSTILE__SECRETKEY=${TURNSTILE_SECRETKEY}'
- 'JWT__KEY=${SERVICE_PASSWORD_JWTKEY}'
web:
image: '{blazor_saas:docker_registry}/{blazor_saas:docker_repository}/web:latest'
depends_on: api
volumes:
- app_data:/data
environment:
- SERVICE_FQDN_WEB_8080
- 'DATAPATH=${DATAPATH}'
- 'TURNSTILE__SITEKEY=${TURNSTILE_SITEKEY}'
- 'JWT__KEY=${SERVICE_PASSWORD_JWTKEY}'
migrations:
image: '{blazor_saas:docker_registry}/{blazor_saas:docker_repository}/migrations:latest'
restart: 'no'
environment:
CONNECTION_STRING: '${CONNECTION_STRING}'

The {blazor_saas:docker_registry} and {blazor_saas:docker_repository} placeholders are replaced with your inputs.

Push to Repository

Commit and push your changes to trigger Coolify’s deployment.

Execute:

Terminal window
git add .
git commit -m "Configure production deployment"
git push origin main

Coolify builds and deploys your Docker images based on the webhook.

Verify Deployment

Check your Coolify dashboard to confirm the app is running.

Visit your configured domain (e.g., web.yourapp.com) to test the deployment.