Quellcode durchsuchen

fix: dockerfile中的镜像

IlhamTahir vor 1 Jahr
Ursprung
Commit
7f1859b838
1 geänderte Dateien mit 3 neuen und 3 gelöschten Zeilen
  1. 3 3
      Dockerfile

+ 3 - 3
Dockerfile

@@ -24,7 +24,8 @@ RUN pnpm run build
 FROM node:22 AS production
 
 # 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
 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 ./
 
 # Install only production dependencies
-RUN pnpm config set registry https://mirrors.cloud.tencent.com/npm/ \
-        && pnpm install --prod
+RUN pnpm install --prod
 
 # Expose the application port
 EXPOSE 3000