Openstatus
www.openstatus.dev
1builders:
2 # Stage 1: Next.js build with Node.js
3 builder:
4 fromImage: node:24-slim
5 workdir: /app
6 copy:
7 - . /app/
8 env:
9 NODE_ENV: production
10 PNPM_HOME: /pnpm
11 PATH: $PNPM_HOME:$PATH
12 # Build-time environment variables (placeholder values, overwritten by .env.docker at runtime)
13 DATABASE_URL: http://libsql:8080
14 DATABASE_AUTH_TOKEN: test
15 NEXT_PUBLIC_OPENPANEL_CLIENT_ID: test
16 NEXT_PUBLIC_URL: http://localhost:3002
17 TEAM_ID_VERCEL: test
18 PROJECT_ID_VERCEL: test
19 VERCEL_AUTH_BEARER_TOKEN: test
20 OPENPANEL_CLIENT_SECRET: test
21 RESEND_API_KEY: test
22 UPSTASH_REDIS_REST_URL: test
23 UPSTASH_REDIS_REST_TOKEN: test
24 UNKEY_TOKEN: test
25 UNKEY_API_ID: test
26 TINY_BIRD_API_KEY: test
27 CRON_SECRET: test
28 STRIPE_SECRET_KEY: test
29 AUTH_SECRET: build-time-placeholder-min-32-chars-long
30 SELF_HOST: "true"
31 run:
32 - corepack enable
33 - pnpm install --frozen-lockfile
34 - pnpm turbo run build --filter=@openstatus/dashboard
35
36# Runtime stage
37fromImage: node:24-slim
38workdir: /app/apps/dashboard
39
40# Copy artifacts from builder
41copy:
42 # Copy Next.js standalone output
43 - fromBuilder: builder
44 source: /app/apps/dashboard/.next/standalone/apps/dashboard/
45 target: ./
46 chmod: "555"
47 # Copy root node_modules (required for pnpm symlinks)
48 - fromBuilder: builder
49 source: /app/node_modules/
50 target: /app/node_modules/
51 # Copy static assets
52 - fromBuilder: builder
53 source: /app/apps/dashboard/.next/static/
54 target: ./.next/static/
55 # Copy public directory
56 - fromBuilder: builder
57 source: /app/apps/dashboard/public/
58 target: ./public/
59
60# Install curl for health checks
61root:
62 run:
63 - apt-get update
64 - apt-get install -y --no-install-recommends curl
65 - rm -rf /var/lib/apt/lists/*
66
67# Security: run as non-root user
68user: "1000:1000"
69
70# Expose port
71expose: "3000"
72
73# Health check
74healthcheck:
75 interval: 30s
76 timeout: 10s
77 start: 45s
78 retries: 3
79 cmd: curl -f http://localhost:3000/ || exit 1
80
81# Start application
82cmd:
83 - node
84 - server.js