···15COPY public ./public
1617# Build the application (if needed)
18-# RUN bun run build
000000001920# Set environment variables (can be overridden at runtime)
21ENV PORT=3000
···24# Expose the application port
25EXPOSE 3000
2627-# Health check
28-HEALTHCHECK --interval=30s --timeout=3s --start-period=5s --retries=3 \
29- CMD bun -e "fetch('http://localhost:3000/health').then(r => r.ok ? process.exit(0) : process.exit(1)).catch(() => process.exit(1))"
30-31# Start the application
32-CMD ["bun", "src/index.ts"]
···15COPY public ./public
1617# Build the application (if needed)
18+RUN bun build \
19+ --compile \
20+ --minify \
21+ --outfile server \
22+ src/index.ts
23+24+FROM scratch AS runtime
25+WORKDIR /app
26+COPY --from=base /app/server /app/server
2728# Set environment variables (can be overridden at runtime)
29ENV PORT=3000
···32# Expose the application port
33EXPOSE 3000
34000035# Start the application
36+CMD ["./server"]