Open-source status page, incident response and uptime monitoring
TypeScript alertingincident-managementmcpmcp-servermonitoringmonitoring-as-codeobservabilityon-callopen-sourcesrestatus-pagestatuspagesynthetic-monitoringterraformtinybirdtursouptimeuptime-checkeruptime-monitor
fix(self-hosting): run database migrations in Coolify deployment (#2621)
Waltrickbf1b728d8b6f
diff --git a/.github/workflows/docker-publish.yml b/.github/workflows/docker-publish.ymlindex 87220d5ab..7e44e7220 100644--- a/.github/workflows/docker-publish.yml+++ b/.github/workflows/docker-publish.yml@@ -18,7 +18,7 @@ on:services:description: 'Services to build (comma-separated)'required: false- default: 'server,dashboard,workflows,private-location,status-page,checker'+ default: 'server,dashboard,workflows,private-location,status-page,checker,db-migrate'type: stringconcurrency:@@ -53,7 +53,7 @@ jobs:# packages/** changes affect all servicesif echo "$CHANGED" | grep -q '^packages/'; then- SERVICES_LIST=("server" "dashboard" "workflows" "private-location" "status-page" "checker")+ SERVICES_LIST=("server" "dashboard" "workflows" "private-location" "status-page" "checker" "db-migrate")elsefor svc in server dashboard workflows private-location status-page checker; doif echo "$CHANGED" | grep -q "^apps/$svc/"; then@@ -101,6 +101,9 @@ jobs:- service: checkercontext: apps/checkerdockerfile: apps/checker/Dockerfile+ - service: db-migrate+ context: .+ dockerfile: packages/db/Dockerfilesteps:- name: Checkout repositorydiff --git a/COOLIFY_ENVIRONMENT_GUIDE.md b/COOLIFY_ENVIRONMENT_GUIDE.mdindex 017d5dee8..af44f0d5b 100644--- a/COOLIFY_ENVIRONMENT_GUIDE.md+++ b/COOLIFY_ENVIRONMENT_GUIDE.md@@ -12,6 +12,8 @@ This guide explains how to configure environment variables for OpenStatus deploy```3. Click **"Deploy"**+> **ℹ️ Database migrations:** the stack includes a one-shot `db-migrate` service that applies the database schema before any app service starts. It runs on every deploy and safely skips already-applied migrations — no manual migration step is needed.+### Step 2: Configure Environment Variables1. After deployment, click on the **OpenStatus stack**2. Go to **"Settings"** → **"Environment Variables"**diff --git a/coolify-deployment.yaml b/coolify-deployment.yamlindex 8af689682..a59c8ff03 100644--- a/coolify-deployment.yaml+++ b/coolify-deployment.yaml@@ -141,6 +141,24 @@ services:reservations:memory: 256M+ # One-shot schema migration. Runs before any app service starts; drizzle+ # skips already-applied migrations, so it is safe on every deploy.+ db-migrate:+ image: ghcr.io/openstatushq/openstatus-db-migrate:latest+ container_name: openstatus-db-migrate+ networks:+ - openstatus+ environment:+ - DATABASE_URL=${DATABASE_URL:-http://libsql:8080}+ - DATABASE_AUTH_TOKEN=${DATABASE_AUTH_TOKEN:-}+ depends_on:+ libsql:+ condition: service_healthy+ # retries absorb transient DB races; exits 0 once migrations are applied+ restart: on-failure:3+ # pull on every deploy so a stale :latest image never skips new migrations+ pull_policy: always+tinybird:image: tinybirdco/tinybird-local:latestcontainer_name: openstatus-tinybird@@ -179,6 +197,8 @@ services:- DATABASE_AUTH_TOKEN=${DATABASE_AUTH_TOKEN:-}- PORT=${WORKFLOWS_PORT:-3000}depends_on:+ db-migrate:+ condition: service_completed_successfullylibsql:condition: service_healthyhealthcheck:@@ -207,6 +227,8 @@ services:- DATABASE_AUTH_TOKEN=${DATABASE_AUTH_TOKEN:-}- PORT=${SERVER_PORT:-3000}depends_on:+ db-migrate:+ condition: service_completed_successfullyworkflows:condition: service_healthylibsql:@@ -296,6 +318,8 @@ services:- HOSTNAME=${DASHBOARD_HOSTNAME:-0.0.0.0}- AUTH_TRUST_HOST=${DASHBOARD_AUTH_TRUST_HOST:-true}depends_on:+ db-migrate:+ condition: service_completed_successfullyworkflows:condition: service_healthylibsql:@@ -331,6 +355,8 @@ services:- AUTH_TRUST_HOST=${STATUS_PAGE_AUTH_TRUST_HOST:-true}- OPENSTATUS_API_URL=${OPENSTATUS_API_URL:-http://server:3000}depends_on:+ db-migrate:+ condition: service_completed_successfullyworkflows:condition: service_healthylibsql: