# 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 production dependencies install: fromImage: oven/bun:1.3.6 workdir: /app/ labels: org.opencontainers.image.stage: install bind: - bunfig.toml - package.json - apps/server/package.json - packages/analytics/package.json - packages/db/package.json - packages/emails/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/assertions/package.json - packages/theme-store/package.json run: bun install --production --frozen-lockfile --verbose cache: - /root/.bun/install/cache # Stage 2: Build application (compile to binary) build: fromImage: oven/bun:1.3.6 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 run: bun build --compile --sourcemap src/index.ts --outfile=app # Runtime stage fromImage: debian:bullseye-slim # 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 # Copy compiled binary copy: - fromBuilder: build source: /app/apps/server/app target: /bin/ chmod: "555" # Install curl for health checks root: run: - apt-get update - apt-get install -y --no-install-recommends curl - rm -rf /var/lib/apt/lists/* # Security: run as non-root user user: "1000:1000" # Expose port expose: "3000" # Health check healthcheck: interval: 30s timeout: 10s start: 30s retries: 3 cmd: curl -f http://localhost:3000/ping || exit 1 # Start application entrypoint: /bin/app