Openstatus
www.openstatus.dev
1# Files to exclude from Docker context
2ignore:
3 - node_modules
4 - /apps/docs
5 - /apps/screenshot-service
6 - /apps/web
7 - /apps/dashboard
8 - /apps/status-page
9 - /apps/workflows
10 - /packages/api
11 - /packages/integrations/vercel
12
13builders:
14 # Stage 1: Install production dependencies
15 install:
16 fromImage: oven/bun:1.3.6
17 workdir: /app/
18 labels:
19 org.opencontainers.image.stage: install
20 bind:
21 - bunfig.toml
22 - package.json
23 - apps/server/package.json
24 - packages/analytics/package.json
25 - packages/db/package.json
26 - packages/proto/package.json
27 - packages/emails/package.json
28 - packages/error/package.json
29 - packages/regions/package.json
30 - packages/tinybird/package.json
31 - packages/tracker/package.json
32 - packages/upstash/package.json
33 - packages/utils/package.json
34 - packages/tsconfig/package.json
35 - packages/assertions/package.json
36 - packages/theme-store/package.json
37 run: bun install --production --frozen-lockfile --verbose
38 cache:
39 - /root/.bun/install/cache
40
41 # Stage 2: Build application (compile to binary)
42 build:
43 fromImage: oven/bun:1.3.6
44 workdir: /app/apps/server
45 labels:
46 org.opencontainers.image.stage: build
47 env:
48 NODE_ENV: production
49 copy:
50 - . /app/
51 - fromBuilder: install
52 source: /app/node_modules
53 target: /app/node_modules
54 run: bun build --compile --sourcemap src/index.ts --outfile=app
55
56# Runtime stage
57fromImage: debian:bullseye-slim
58
59# Metadata labels
60labels:
61 org.opencontainers.image.title: OpenStatus Server
62 org.opencontainers.image.description: REST API server with Hono framework for OpenStatus
63 org.opencontainers.image.source: https://github.com/openstatusHQ/openstatus
64 org.opencontainers.image.vendor: OpenStatus
65 org.opencontainers.image.authors: OpenStatus Team
66
67# Copy compiled binary
68copy:
69 - fromBuilder: build
70 source: /app/apps/server/app
71 target: /bin/
72 chmod: "555"
73
74# Install curl for health checks
75root:
76 run:
77 - apt-get update
78 - apt-get install -y --no-install-recommends curl
79 - rm -rf /var/lib/apt/lists/*
80
81# Security: run as non-root user
82user: "1000:1000"
83
84# Expose port
85expose: "3000"
86
87# Health check
88healthcheck:
89 interval: 30s
90 timeout: 10s
91 start: 30s
92 retries: 3
93 cmd: curl -f http://localhost:3000/ping || exit 1
94
95# Start application
96entrypoint: /bin/app