Commit 1207e4b7 by jianan

fix(docker): 运行时固定 nginx:1.26-alpine,兼容老内核 seccomp

parent 281b235a
......@@ -15,11 +15,9 @@ RUN npm ci
COPY . .
RUN npm run build
# 纯静态托管:只做 SPA 回退;接口反代由测试环境统一 nginx 负责,本容器不感知后端
FROM nginx:alpine
# 纯静态托管:只做 SPA 回退;接口反代由测试环境统一 nginx 负责,本容器不感知后端。
# 固定 1.26:最新 nginx:alpine(1.31/Alpine15) 在本机老内核(3.10)+seccomp 下
# 守护进程写 pid 报 EPERM,1.26 与现网容器同代、实测正常。
FROM nginx:1.26-alpine
COPY --from=build /app/dist /usr/share/nginx/html
COPY nginx.conf /etc/nginx/conf.d/default.conf
# 老内核(CentOS7)下容器内 /run 不可写:把主配置里的 pid 从 /run 改到 /tmp
# (官方镜像默认是 daemon off,直接沿用,无需再传 pid 参数)
RUN sed -i -E 's#^pid[[:space:]]+[^;]+;#pid /tmp/nginx.pid;#' /etc/nginx/nginx.conf
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment