소스 검색

pref: 加速构建配置

wuwenyi 2 주 전
부모
커밋
5656271ce5
2개의 변경된 파일8개의 추가작업 그리고 1개의 파일을 삭제
  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