# Use official Bun image with Alpine for smaller size FROM oven/bun:1.1-alpine as base WORKDIR /app # Install dependencies first (better layer caching) COPY package.json bun.lock ./ RUN bun install # Copy only necessary files COPY src/ ./src/ COPY index.ts ./ # Health check HEALTHCHECK --interval=30s --timeout=3s \ CMD curl -f http://localhost:${PORT:-3007}/health || exit 1 # Server runs on port from environment variable EXPOSE ${PORT:-3007} # Start the server CMD ["bun", "run", "index.ts"]