Browse Source

fix: 生成pdf请求的端口问题

大侠咬超人 4 days ago
parent
commit
422ab2c4a5
2 changed files with 5 additions and 3 deletions
  1. 2 3
      Dockerfile
  2. 3 0
      docker-compose.yml

+ 2 - 3
Dockerfile

@@ -93,9 +93,8 @@ COPY . .
 # 从第一阶段复制构建好的前端资源
 # 从第一阶段复制构建好的前端资源
 COPY --from=frontend-builder /app/public/build ./public/build
 COPY --from=frontend-builder /app/public/build ./public/build
 
 
-# 缓存 Laravel 配置和路由
-RUN php artisan config:cache && \
-    php artisan route:cache && \
+# 缓存路由和视图(不缓存配置,配置在运行时从 .env 读取)
+RUN php artisan route:cache && \
     php artisan view:cache && \
     php artisan view:cache && \
     php artisan filament:upgrade || true
     php artisan filament:upgrade || true
 
 

+ 3 - 0
docker-compose.yml

@@ -10,6 +10,7 @@ services:
       - .env
       - .env
     volumes:
     volumes:
       - ./storage:/app/storage  # 日志 + 临时文件 + OCR上传
       - ./storage:/app/storage  # 日志 + 临时文件 + OCR上传
+      - ./.env:/app/.env        # 环境配置文件
     restart: unless-stopped
     restart: unless-stopped
     healthcheck:
     healthcheck:
       test: ["CMD-SHELL", "curl -f http://localhost:8000/health || exit 1"]
       test: ["CMD-SHELL", "curl -f http://localhost:8000/health || exit 1"]
@@ -27,6 +28,7 @@ services:
       - .env
       - .env
     volumes:
     volumes:
       - ./storage:/app/storage
       - ./storage:/app/storage
+      - ./.env:/app/.env
     restart: unless-stopped
     restart: unless-stopped
     deploy:
     deploy:
       resources:
       resources:
@@ -43,6 +45,7 @@ services:
       - .env
       - .env
     volumes:
     volumes:
       - ./storage:/app/storage
       - ./storage:/app/storage
+      - ./.env:/app/.env
     restart: unless-stopped
     restart: unless-stopped
     deploy:
     deploy:
       resources:
       resources: