修复Docker构建:npm install + 修复webpack ProgressPlugin兼容性

This commit is contained in:
wyxfzgg 2026-05-13 10:34:41 +08:00
parent 8adcfce2c8
commit 68b20ab6be
1 changed files with 3 additions and 0 deletions

View File

@ -6,6 +6,9 @@ WORKDIR /gitlink_help_center
COPY ./ /gitlink_help_center/
RUN npm install --legacy-peer-deps
RUN node -e "const fs=require('fs');['node_modules/@docusaurus/bundler/lib/compiler.js','node_modules/@docusaurus/bundler/lib/webpack/utils.js'].forEach(f=>{try{let c=fs.readFileSync(f,'utf8');c=c.replace(/new\s+\w*\.?ProgressPlugin\(\s*\{[\s\S]*?\}\s*\)/g,'new webpack.ProgressPlugin()');fs.writeFileSync(f,c)}catch(e){}})"
ENV CI=true
RUN npm run build -- --locale zh-cn
CMD ["npm", "run", "serve"]