Openstatus www.openstatus.dev
at 4c0f4c00a38753a5d0dfd7e7b7b7706dec6f1503 95 lines 2.4 kB view raw
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/emails/package.json 27 - packages/error/package.json 28 - packages/regions/package.json 29 - packages/tinybird/package.json 30 - packages/tracker/package.json 31 - packages/upstash/package.json 32 - packages/utils/package.json 33 - packages/tsconfig/package.json 34 - packages/assertions/package.json 35 - packages/theme-store/package.json 36 run: bun install --production --frozen-lockfile --verbose 37 cache: 38 - /root/.bun/install/cache 39 40 # Stage 2: Build application (compile to binary) 41 build: 42 fromImage: oven/bun:1.3.6 43 workdir: /app/apps/server 44 labels: 45 org.opencontainers.image.stage: build 46 env: 47 NODE_ENV: production 48 copy: 49 - . /app/ 50 - fromBuilder: install 51 source: /app/node_modules 52 target: /app/node_modules 53 run: bun build --compile --sourcemap src/index.ts --outfile=app 54 55# Runtime stage 56fromImage: debian:bullseye-slim 57 58# Metadata labels 59labels: 60 org.opencontainers.image.title: OpenStatus Server 61 org.opencontainers.image.description: REST API server with Hono framework for OpenStatus 62 org.opencontainers.image.source: https://github.com/openstatusHQ/openstatus 63 org.opencontainers.image.vendor: OpenStatus 64 org.opencontainers.image.authors: OpenStatus Team 65 66# Copy compiled binary 67copy: 68 - fromBuilder: build 69 source: /app/apps/server/app 70 target: /bin/ 71 chmod: "555" 72 73# Install curl for health checks 74root: 75 run: 76 - apt-get update 77 - apt-get install -y --no-install-recommends curl 78 - rm -rf /var/lib/apt/lists/* 79 80# Security: run as non-root user 81user: "1000:1000" 82 83# Expose port 84expose: "3000" 85 86# Health check 87healthcheck: 88 interval: 30s 89 timeout: 10s 90 start: 30s 91 retries: 3 92 cmd: curl -f http://localhost:3000/ping || exit 1 93 94# Start application 95entrypoint: /bin/app