fix: single-stage bun Dockerfile to fix module compatibility
This commit is contained in:
22
Dockerfile
22
Dockerfile
@@ -1,5 +1,4 @@
|
|||||||
# Stage 1 — install deps & build
|
FROM oven/bun:1.2
|
||||||
FROM oven/bun:1.2 AS builder
|
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
|
|
||||||
COPY package.json bun.lock ./
|
COPY package.json bun.lock ./
|
||||||
@@ -10,20 +9,11 @@ COPY . .
|
|||||||
ARG STRAPI_URL=https://strapi.moshariri.com
|
ARG STRAPI_URL=https://strapi.moshariri.com
|
||||||
ENV STRAPI_URL=$STRAPI_URL
|
ENV STRAPI_URL=$STRAPI_URL
|
||||||
ENV NODE_ENV=production
|
ENV NODE_ENV=production
|
||||||
|
|
||||||
RUN set -e && bun run build && echo "Build output:" && ls -la dist/server/
|
|
||||||
|
|
||||||
# Stage 2 — production runtime
|
|
||||||
FROM node:22-alpine AS runner
|
|
||||||
WORKDIR /app
|
|
||||||
|
|
||||||
COPY --from=builder /app/dist ./dist
|
|
||||||
COPY --from=builder /app/node_modules ./node_modules
|
|
||||||
COPY --from=builder /app/package.json ./package.json
|
|
||||||
|
|
||||||
EXPOSE 3000
|
|
||||||
ENV NODE_ENV=production
|
|
||||||
ENV HOST=0.0.0.0
|
ENV HOST=0.0.0.0
|
||||||
ENV PORT=3000
|
ENV PORT=3000
|
||||||
|
|
||||||
CMD ["node", "dist/server/server.js"]
|
RUN bun run build
|
||||||
|
|
||||||
|
EXPOSE 3000
|
||||||
|
|
||||||
|
CMD ["bun", "run", "dist/server/server.js"]
|
||||||
|
|||||||
Reference in New Issue
Block a user