try fix pnpm symlink error on deploy
All checks were successful
Deploy App / build (push) Successful in 1m55s
Deploy App / deploy (push) Successful in 46s

This commit is contained in:
valere
2025-11-07 13:59:31 +01:00
parent 4014335150
commit 47b601c9bf
2 changed files with 15 additions and 12 deletions

6
.dockerignore Normal file
View File

@@ -0,0 +1,6 @@
node_modules
.pnpm-store
.output
dist
.git
Dockerfile

View File

@@ -1,22 +1,19 @@
# Stage de build
FROM node:20-alpine AS build
# Stage 1: Build
FROM node:20 AS builder
WORKDIR /app
RUN npm install -g pnpm
COPY package.json pnpm-lock.yaml* ./
RUN pnpm install --frozen-lockfile
COPY package.json pnpm-lock.yaml ./
RUN npm install -g pnpm && pnpm install --frozen-lockfile
COPY . .
RUN pnpm build
# Stage production
FROM node:20-alpine
# Stage 2: Runtime
FROM node:20-slim AS runner
WORKDIR /app
COPY --from=build /app/.output .output
COPY --from=build /app/package.json ./
COPY --from=build /app/node_modules ./node_modules
COPY --from=builder /app/.output ./.output
COPY package.json pnpm-lock.yaml ./
EXPOSE 3000
CMD ["node", ".output/server/index.mjs"]