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
|
# Stage 1: Build
|
||||||
FROM node:20-alpine AS build
|
FROM node:20 AS builder
|
||||||
|
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
|
|
||||||
RUN npm install -g pnpm
|
COPY package.json pnpm-lock.yaml ./
|
||||||
COPY package.json pnpm-lock.yaml* ./
|
RUN npm install -g pnpm && pnpm install --frozen-lockfile
|
||||||
RUN pnpm install --frozen-lockfile
|
|
||||||
COPY . .
|
COPY . .
|
||||||
RUN pnpm build
|
RUN pnpm build
|
||||||
|
|
||||||
# Stage production
|
# Stage 2: Runtime
|
||||||
FROM node:20-alpine
|
FROM node:20-slim AS runner
|
||||||
|
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
|
|
||||||
COPY --from=build /app/.output .output
|
COPY --from=builder /app/.output ./.output
|
||||||
COPY --from=build /app/package.json ./
|
COPY package.json pnpm-lock.yaml ./
|
||||||
COPY --from=build /app/node_modules ./node_modules
|
|
||||||
|
|
||||||
EXPOSE 3000
|
EXPOSE 3000
|
||||||
CMD ["node", ".output/server/index.mjs"]
|
CMD ["node", ".output/server/index.mjs"]
|
||||||
|
|||||||
Reference in New Issue
Block a user