Răsfoiți Sursa

perf: mount nginx.conf into container to avoid rebuild on config changes

Add ./docker/nginx.conf volume mount to all mount.yml files. After
this, changing nginx.conf only needs a reload, not a full image
rebuild (~10min). Applicable to all 4 servers.

Quick reload after nginx change:
  docker exec math_cms_app nginx -s reload

Co-authored-by: Cursor <cursoragent@cursor.com>
yemeishu 3 zile în urmă
părinte
comite
74d6196153

+ 1 - 0
docker-compose.api.mount.yml

@@ -12,5 +12,6 @@ services:
       - .:/app                          # 代码目录映射(含 public/build)
       - /app/vendor                     # 排除 vendor(用镜像里的)
       - /app/node_modules               # 排除 node_modules
+      - ./docker/nginx.conf:/etc/nginx/nginx.conf  # nginx 配置挂载,改完 reload 即可
       - ./storage:/app/storage          # 保留:日志 + 临时文件
       - ./.env:/app/.env                # 保留:环境配置

+ 1 - 1
docker-compose.mount.yml

@@ -5,7 +5,6 @@
 #   或手动:docker compose -f docker-compose.yml -f docker-compose.mount.yml up -d
 #
 # 前端构建产物由 deploy.sh 在宿主机上构建后通过 .:/app 挂载进入容器
-# 不再使用 /app/public/build anonymous volume(避免哈希不同步导致 404)
 
 services:
   app:
@@ -13,6 +12,7 @@ services:
       - .:/app                          # 代码目录映射(含 public/build)
       - /app/vendor                     # 排除 vendor(用镜像里的)
       - /app/node_modules               # 排除 node_modules
+      - ./docker/nginx.conf:/etc/nginx/nginx.conf  # nginx 配置挂载,改完 reload 即可
       - ./storage:/app/storage          # 保留:日志 + 临时文件
       - ./.env:/app/.env                # 保留:环境配置
 

+ 1 - 0
docker-compose.pdf.mount.yml

@@ -12,6 +12,7 @@ services:
       - .:/app                          # 代码目录映射(含 public/build)
       - /app/vendor                     # 排除 vendor(用镜像里的)
       - /app/node_modules               # 排除 node_modules
+      - ./docker/nginx.conf:/etc/nginx/nginx.conf  # nginx 配置挂载,改完 reload 即可
       - ./storage:/app/storage          # 保留:日志 + 临时文件
       - ./.env:/app/.env                # 保留:环境配置