Sfoglia il codice sorgente

pref: 加速构建配置

wuwenyi 2 settimane fa
parent
commit
5656271ce5
2 ha cambiato i file con 8 aggiunte e 1 eliminazioni
  1. 6 0
      .dockerignore
  2. 2 1
      Dockerfile

+ 6 - 0
.dockerignore

@@ -3,3 +3,9 @@ dist
 .git
 .idea
 *.iml
+*.md
+.DS_Store
+.gitignore
+docker-compose*.yml
+Dockerfile
+.dockerignore

+ 2 - 1
Dockerfile

@@ -1,8 +1,9 @@
+# syntax=docker/dockerfile:1
 FROM node:18-alpine AS build
 WORKDIR /app
 RUN npm config set registry https://registry.npmmirror.com
 COPY package*.json ./
-RUN npm ci --legacy-peer-deps
+RUN --mount=type=cache,target=/root/.npm npm ci --legacy-peer-deps
 COPY . .
 RUN npx vite build