mirror of
https://github.com/Kizuren/kizuren.dev.git
synced 2025-12-21 21:16:12 +01:00
Updated Dockerfile for bun
This commit is contained in:
parent
4e2c6c7626
commit
b3ca79c728
1 changed files with 17 additions and 9 deletions
26
Dockerfile
26
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"]
|
||||
|
||||
CMD ["bun", ".output/server/index.mjs"]
|
||||
Loading…
Add table
Add a link
Reference in a new issue