mirror of
https://github.com/Kizuren/kizuren.dev.git
synced 2026-01-06 14:37:45 +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
|
FROM oven/bun:1 AS builder
|
||||||
WORKDIR /app
|
|
||||||
COPY package*.json ./
|
WORKDIR /app
|
||||||
RUN npm ci
|
COPY package.json bun.lock ./
|
||||||
COPY . .
|
RUN bun install --frozen-lockfile
|
||||||
RUN npm run build
|
COPY . .
|
||||||
|
|
||||||
|
RUN bun run build
|
||||||
|
|
||||||
|
FROM oven/bun:1-slim AS runner
|
||||||
|
|
||||||
FROM node:20-alpine
|
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
COPY --from=build /app/.output /app/.output
|
|
||||||
ENV NODE_ENV=production
|
ENV NODE_ENV=production
|
||||||
ENV PORT=3000
|
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
|
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