Skip to content

Open-source status page, incident response and uptime monitoring

4.0 KB
Raw Blame
# Files to exclude from Docker context
ignore:
  - node_modules
  - /apps/docs
  - /apps/screenshot-service
  - /apps/web
  - /apps/dashboard
  - /apps/status-page
  - /apps/workflows
  - /packages/api
  - /packages/integrations/vercel

builders:
  # Stage 1: Install dependencies (dev included: the build stage needs tsdown)
  install:
    fromImage: node:26.8.1-slim
    workdir: /app/
    labels:
      org.opencontainers.image.stage: install
    bind:
      - pnpm-workspace.yaml
      - pnpm-lock.yaml
      - package.json
      - apps/server/package.json
      - packages/analytics/package.json
      - packages/db/package.json
      - packages/proto/package.json
      - packages/emails/package.json
      - packages/notifications/base/package.json
      - packages/notifications/discord/package.json
      - packages/notifications/email/package.json
      - packages/notifications/grafana-oncall/package.json
      - packages/notifications/google-chat/package.json
      - packages/notifications/ms-teams/package.json
      - packages/notifications/ntfy/package.json
      - packages/notifications/opsgenie/package.json
      - packages/notifications/pagerduty/package.json
      - packages/notifications/slack/package.json
      - packages/notifications/telegram/package.json
      - packages/notifications/bird-whatsapp/package.json
      - packages/notifications/twillio-sms/package.json
      - packages/notifications/webhook/package.json
      - packages/error/package.json
      - packages/regions/package.json
      - packages/tinybird/package.json
      - packages/tracker/package.json
      - packages/upstash/package.json
      - packages/utils/package.json
      - packages/tsconfig/package.json
      - packages/test-utils/package.json
      - packages/subscriptions/package.json
      - packages/assertions/package.json
      - packages/theme-store/package.json
      - packages/locales/package.json
      - packages/services/package.json
      - packages/importers/package.json
    run:
      # Node 25+ no longer bundles corepack
      - npm install -g [email protected]
      - corepack enable pnpm
      - pnpm install --frozen-lockfile --filter=@openstatus/server... --loglevel debug
    cache:
      - /root/.local/share/pnpm/store

  # Stage 2: Bundle the app with tsdown into dist/ (every dependency inlined)
  build:
    fromImage: node:26.8.1-slim
    workdir: /app/apps/server
    labels:
      org.opencontainers.image.stage: build
    env:
      NODE_ENV: production
    copy:
      - . /app/
      - fromBuilder: install
        source: /app/node_modules
        target: /app/node_modules
      - fromBuilder: install
        source: /app/apps/server/node_modules
        target: /app/apps/server/node_modules
      - fromBuilder: install
        source: /app/packages
        target: /app/packages
    run:
      - ./node_modules/.bin/tsdown

# Runtime stage: Node plus curl for the healthcheck. No ca-certificates: the server talks to libSQL
# over HTTP (pure JS) and Node bundles its own CA store, so nothing reads the system one.
fromImage: node:26.8.1-slim
root:
  run:
    # One chained command: dofigen emits a heredoc RUN, which doesn't stop on a failed line
    - apt-get update && apt-get install -y --no-install-recommends curl && rm -rf /var/lib/apt/lists/*
workdir: /app/

# Metadata labels
labels:
  org.opencontainers.image.title: OpenStatus Server
  org.opencontainers.image.description: REST API server with Hono framework for OpenStatus
  org.opencontainers.image.source: https://github.com/openstatusHQ/openstatus
  org.opencontainers.image.vendor: OpenStatus
  org.opencontainers.image.authors: OpenStatus Team

env:
  NODE_ENV: production

# Copy the bundle
copy:
  - fromBuilder: build
    source: /app/apps/server/dist
    target: /app/dist
    chmod: "555"

# Security: run as non-root user
user: "1000:1000"

# Expose port
expose: "3000"

healthcheck:
  interval: 30s
  timeout: 10s
  start: 30s
  retries: 3
  cmd: '["curl", "-f", "http://localhost:3000/ping"]'

# Start application
entrypoint: ["node", "/app/dist/serve.mjs"]