# Use Bun image FROM oven/bun:1.1.0 AS runner WORKDIR /app ENV NODE_ENV=production ENV PORT=8080 # Create data directory for SQLite RUN mkdir -p /app/data # Copy node_modules first (from local build) COPY node_modules ./node_modules # Copy source files COPY public ./public COPY src ./src COPY package.json ./ COPY data ./data # Bun has fetch built-in, use it for health check via bun command # HEALTHCHECK will use bun's built-in fetch # Expose port EXPOSE 8080 # Health check using bun's built-in fetch HEALTHCHECK --interval=30s --timeout=3s --start-period=5s --retries=3 \ CMD bun -e "fetch('http://localhost:8080/api/settings').then(r=>process.exit(r.ok?0:1)).catch(()=>process.exit(1))" || exit 1 # Start server CMD ["bun", "run", "src/server/index.ts"]