瀏覽代碼

fix: dockerfile中的镜像

IlhamTahir 1 年之前
父節點
當前提交
7f1859b838
共有 1 個文件被更改,包括 3 次插入3 次删除
  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