Update Dockerfile
Browse files- Dockerfile +3 -3
Dockerfile
CHANGED
|
@@ -7,9 +7,9 @@ WORKDIR /app
|
|
| 7 |
RUN sed -i "s|join(__dirname, '../public')|process.cwd() + '/public'|g" src/index.js
|
| 8 |
RUN sed -i "s|join(publicPath, 'index.html')|process.cwd() + '/public/index.html'|g" src/index.js
|
| 9 |
|
| 10 |
-
# 2. 【
|
| 11 |
-
#
|
| 12 |
-
RUN sed -i 's|<head>|<head><script>window.
|
| 13 |
|
| 14 |
RUN npm install
|
| 15 |
ENV PORT=7860
|
|
|
|
| 7 |
RUN sed -i "s|join(__dirname, '../public')|process.cwd() + '/public'|g" src/index.js
|
| 8 |
RUN sed -i "s|join(publicPath, 'index.html')|process.cwd() + '/public/index.html'|g" src/index.js
|
| 9 |
|
| 10 |
+
# 2. 【核心修复】注入 SharedWorker 补丁,防止脚本崩溃
|
| 11 |
+
# 这段 JS 会在报错前伪造一个 SharedWorker 对象,让 UV 的脚本能继续跑下去
|
| 12 |
+
RUN sed -i 's|<head>|<head><script>if(!window.SharedWorker){window.SharedWorker=function(){return{port:{start:function(){},postMessage:function(){}},addEventListener:function(){}}};console.log("已降级兼容模式");}</script>|' public/index.html
|
| 13 |
|
| 14 |
RUN npm install
|
| 15 |
ENV PORT=7860
|