# Stage 1: Build FROM oven/bun:latest AS builder WORKDIR /app COPY . . RUN bun install --frozen-lockfile RUN bun run build # Stage 2: Production Runtime FROM oven/bun:latest WORKDIR /app # Copy only necessary files from the builder COPY --from=builder /app/build ./build COPY --from=builder /app/package.json . ENV PORT=3167 EXPOSE 3167 USER bun # Run the application from the build directory CMD ["bun", "build/index.js"]