Update Dockerfile
Browse files- Dockerfile +4 -0
Dockerfile
CHANGED
|
@@ -9,6 +9,10 @@ RUN git clone https://github.com/titaniumnetwork-dev/Ultraviolet-App.git /app
|
|
| 9 |
|
| 10 |
WORKDIR /app
|
| 11 |
|
|
|
|
|
|
|
|
|
|
|
|
|
| 12 |
# 安装依赖
|
| 13 |
RUN npm install
|
| 14 |
|
|
|
|
| 9 |
|
| 10 |
WORKDIR /app
|
| 11 |
|
| 12 |
+
# --- 核心修复步骤:修复 src/index.js 中的路径问题 ---
|
| 13 |
+
# 使用 sed 命令将 res.sendFile(path) 修改为包含 root 参数的形式
|
| 14 |
+
RUN sed -i 's|res.sendFile(\([^,)]*\))|res.sendFile(\1, { root: process.cwd() + "/static" })|g' /app/src/index.js || true
|
| 15 |
+
|
| 16 |
# 安装依赖
|
| 17 |
RUN npm install
|
| 18 |
|