try fix pnpm symlink error on deploy
This commit is contained in:
6
.dockerignore
Normal file
6
.dockerignore
Normal file
@@ -0,0 +1,6 @@
|
||||
node_modules
|
||||
.pnpm-store
|
||||
.output
|
||||
dist
|
||||
.git
|
||||
Dockerfile
|
||||
21
Dockerfile
21
Dockerfile
@@ -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"]
|
||||
|
||||
Reference in New Issue
Block a user