Updated Dockerfile for bun

This commit is contained in:
Kizuren 2025-09-02 00:29:23 +02:00
parent 4e2c6c7626
commit b3ca79c728

View file

@ -1,15 +1,23 @@
FROM node:20-alpine AS build
WORKDIR /app
COPY package*.json ./
RUN npm ci
COPY . .
RUN npm run build
FROM oven/bun:1 AS builder
WORKDIR /app
COPY package.json bun.lock ./
RUN bun install --frozen-lockfile
COPY . .
RUN bun run build
FROM oven/bun:1-slim AS runner
FROM node:20-alpine
WORKDIR /app
COPY --from=build /app/.output /app/.output
ENV NODE_ENV=production
ENV PORT=3000
COPY --from=builder /app/.output /app/.output
COPY --from=builder /app/package.json ./
COPY --from=builder /app/bun.lock ./
RUN bun install --production
EXPOSE 3000
CMD ["node", ".output/server/index.mjs"]
CMD ["bun", ".output/server/index.mjs"]