# Use the official Bun image as base - much smaller than Node.js FROM oven/bun:1-slim as base # Set working directory WORKDIR /app # Copy package files COPY package.json bun.lockb* ./ # Install dependencies RUN bun install --frozen-lockfile --production # Copy source code COPY src/ ./src/ # Expose the port EXPOSE 9999 # Create non-root user for security RUN addgroup --system --gid 1001 bunuser && \ adduser --system --uid 1001 bunuser # Change ownership of the app directory RUN chown -R bunuser:bunuser /app USER bunuser # Health check HEALTHCHECK --interval=30s --timeout=3s --start-period=5s --retries=3 \ CMD bun --version || exit 1 # Start the application CMD ["bun", "run", "start"]