# Use official Bun image FROM oven/bun:1.3 AS base # Set working directory WORKDIR /app # Copy package files COPY package.json bun.lock* ./ # Install dependencies RUN bun install --frozen-lockfile # Copy source code COPY src ./src COPY public ./public # Build the application (if needed) # RUN bun run build # Set environment variables (can be overridden at runtime) ENV PORT=3000 ENV NODE_ENV=production # Expose the application port EXPOSE 3000 # Health check HEALTHCHECK --interval=30s --timeout=3s --start-period=5s --retries=3 \ CMD bun -e "fetch('http://localhost:3000/health').then(r => r.ok ? process.exit(0) : process.exit(1)).catch(() => process.exit(1))" # Start the application CMD ["bun", "src/index.ts"]