fix: add cache clearing and cache-busting to Dockerfile

- Add explicit cache clearing for .docusaurus and build directories
- Add build arguments (BUILD_DATE, BUILD_VERSION) to force Docker layer cache invalidation
- This ensures clean builds without cached artifacts from previous builds
- Should resolve persistent ProgressPanel component errors
This commit is contained in:
zzx-coder 2026-05-14 13:14:07 +08:00
parent 7d86c161aa
commit 10f888aed5
1 changed files with 7 additions and 0 deletions

View File

@ -19,7 +19,14 @@ COPY package.json package-lock.json ./
# 安装依赖忽略peer依赖冲突
RUN npm install --legacy-peer-deps
# 复制项目文件
# 添加时间戳以破坏缓存
ARG BUILD_DATE
ARG BUILD_VERSION
ENV BUILD_DATE=$BUILD_DATE
ENV BUILD_VERSION=$BUILD_VERSION
COPY . .
# 清理Docusaurus缓存和构建目录
RUN rm -rf .docusaurus build
# 构建应用
RUN npm run build
# 暴露端口