Commit 281b235a by jianan

fix(docker): 替换主配置 pid 路径到 /tmp,规避重复指令与 /run 不可写

parent 0075b471
...@@ -20,5 +20,6 @@ FROM nginx:alpine ...@@ -20,5 +20,6 @@ FROM nginx:alpine
COPY --from=build /app/dist /usr/share/nginx/html COPY --from=build /app/dist /usr/share/nginx/html
COPY nginx.conf /etc/nginx/conf.d/default.conf COPY nginx.conf /etc/nginx/conf.d/default.conf
# 老内核(CentOS7)下容器内 /run 不可写,pid 改放 /tmp,避免 master 写 pid 失败而退出 # 老内核(CentOS7)下容器内 /run 不可写:把主配置里的 pid 从 /run 改到 /tmp
CMD ["nginx", "-g", "daemon off; pid /tmp/nginx.pid;"] # (官方镜像默认是 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