fix: dockerfile中的镜像

This commit is contained in:
ilhamtahir committed 2024-11-17 15:48:29 +08:00
1 parent 163392d9d4
commit 7f1859b838
1 file changed
+3 -3
+3 -3
View File
@@ -24,7 +24,8 @@ RUN pnpm run build
FROM node:22 AS production FROM node:22 AS production
# Set npm registry to Tencent Cloud and install pnpm globally # Set npm registry to Tencent Cloud and install pnpm globally
RUN npm install -g pnpm@latest RUN pnpm config set registry https://mirrors.cloud.tencent.com/npm/ \
&& npm install -g pnpm@latest
# Set the working directory inside the container # Set the working directory inside the container
WORKDIR /usr/src/app WORKDIR /usr/src/app
@@ -34,8 +35,7 @@ COPY --from=builder /usr/src/app/dist ./dist
COPY --from=builder /usr/src/app/package.json /usr/src/app/pnpm-lock.yaml ./ COPY --from=builder /usr/src/app/package.json /usr/src/app/pnpm-lock.yaml ./
# Install only production dependencies # Install only production dependencies
RUN pnpm config set registry https://mirrors.cloud.tencent.com/npm/ \ RUN pnpm install --prod
&& pnpm install --prod
# Expose the application port # Expose the application port
EXPOSE 3000 EXPOSE 3000