# Build stage FROM oven/bun:latest as builder WORKDIR /app # Copy package files COPY package.json bun.lock* ./ # Install all dependencies (including devDependencies for building) RUN bun install --frozen-lockfile # Copy source code COPY . . # Build the application RUN bun run build # Production stage FROM oven/bun:latest WORKDIR /app # Copy package files COPY package.json bun.lock* ./ # Install only production dependencies RUN bun install --frozen-lockfile --production # Copy built application and server COPY --from=builder /app/dist ./dist COPY src/server.ts ./src/server.ts # Expose the port EXPOSE 3000 # Start the application CMD ["bun", "run", "prod"]