Docker 构建加固:npm ci + 依赖自检;新增预构建 Dockerfile 与 dist 产物
This commit is contained in:
+4
-1
@@ -10,7 +10,10 @@ COPY package.json package-lock.json* ./
|
||||
|
||||
# 国内网络环境可取消下一行注释使用镜像源
|
||||
# RUN npm config set registry https://registry.npmmirror.com
|
||||
RUN npm install --include=dev
|
||||
RUN npm ci --include=dev
|
||||
|
||||
# 依赖自检:如果 tsc/vite 没装上,在这里就明确失败而不是 127
|
||||
RUN ./node_modules/.bin/tsc --version && ./node_modules/.bin/vite --version
|
||||
|
||||
# 拷贝源码并构建(产物输出到 /app/dist)
|
||||
COPY . .
|
||||
|
||||
Reference in New Issue
Block a user