diff --git a/Dockerfile b/Dockerfile index 96240aa..5fdbd47 100644 --- a/Dockerfile +++ b/Dockerfile @@ -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"] \ No newline at end of file + +CMD ["bun", ".output/server/index.mjs"] \ No newline at end of file