Merge pull request #122 from 1014TaoTao/v2.0.0

fix(deploy): 修复容器日志显示和nginx配置路径问题
This commit is contained in:
fastapiadmin
2025-08-17 14:59:10 +08:00
committed by GitHub
4 changed files with 16 additions and 23 deletions
+1 -1
View File
@@ -136,7 +136,7 @@ start_containers() {
# 显示容器日志 # 显示容器日志
log "📋 获取容器日志..." "INFO" log "📋 获取容器日志..." "INFO"
docker compose logs --tail=20 || { log "❌ 容器日志获取失败" "ERROR"; exit 1; } docker compose logs || { log "❌ 容器日志获取失败" "ERROR"; exit 1; }
log "✅ 容器启动成功" "INFO" log "✅ 容器启动成功" "INFO"
} }
+12 -14
View File
@@ -27,37 +27,35 @@ http {
# server 块 # server 块
server { server {
# 监听端口 # 监听端
listen 80; listen 80;
# 服务名 # 服务名
server_name frontend; server_name localhost;
# 官网代理 # 官网代理 - 根路径访问官网
location / { location / {
root /usr/share/nginx/html; #nginx容器规定位置; root /usr/share/nginx/html/fastdocs/dist;
index index.html index.htm; index index.html index.htm;
try_files $uri $uri/ /fastdocs/index.html; #解决页面刷新404问题 try_files $uri $uri/ /index.html; #解决页面刷新404问题
} }
# 前端代理 # 前端代理 - /web访问前端
location /web { location /web {
root /usr/share/nginx/html; #nginx容器规定位置; alias /usr/share/nginx/html/frontend/dist;
index index.html index.htm; index index.html index.htm;
try_files $uri $uri/ /frontend/index.html; #解决页面刷新404问题 try_files $uri $uri/ /web/index.html; #解决页面刷新404问题
} }
# 小程序代理 # 小程序代理 - /app访问小程序
location /app { location /app {
root /usr/share/nginx/html; #nginx容器规定位置; alias /usr/share/nginx/html/fastapp/dist/build/h5;
index index.html index.htm; index index.html index.htm;
try_files $uri $uri/ /fastapp/index.html; #解决页面刷新404问题 try_files $uri $uri/ /app/index.html; #解决页面刷新404问题
} }
# 后端代理 # 后端代理
location /api/v1 { location /api/v1 {
proxy_set_header Host $host; proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
+3 -3
View File
@@ -66,9 +66,9 @@ services:
- "80:80" - "80:80"
volumes: volumes:
- ./devops/nginx/nginx.conf:/etc/nginx/nginx.conf - ./devops/nginx/nginx.conf:/etc/nginx/nginx.conf
- ./frontend/dist:/usr/share/nginx/html/frontend - ./frontend/dist:/usr/share/nginx/html/frontend/dist
- ./fastapp/dist/build/h5:/usr/share/nginx/html/fastapp - ./fastapp/dist/build/h5:/usr/share/nginx/html/fastapp/dist/build/h5
- ./fastdocs/dist:/usr/share/nginx/html/fastdocs - ./fastdocs/dist:/usr/share/nginx/html/fastdocs/dist
depends_on: depends_on:
- backend - backend
networks: networks:
-5
View File
@@ -21,7 +21,6 @@ declare module 'vue' {
DatePicker: typeof import('./../components/DatePicker/index.vue')['default'] DatePicker: typeof import('./../components/DatePicker/index.vue')['default']
DeptTree: typeof import('./../views/system/user/components/DeptTree.vue')['default'] DeptTree: typeof import('./../views/system/user/components/DeptTree.vue')['default']
ECharts: typeof import('./../components/ECharts/index.vue')['default'] ECharts: typeof import('./../components/ECharts/index.vue')['default']
ElAlert: typeof import('element-plus/es')['ElAlert']
ElAside: typeof import('element-plus/es')['ElAside'] ElAside: typeof import('element-plus/es')['ElAside']
ElAvatar: typeof import('element-plus/es')['ElAvatar'] ElAvatar: typeof import('element-plus/es')['ElAvatar']
ElBacktop: typeof import('element-plus/es')['ElBacktop'] ElBacktop: typeof import('element-plus/es')['ElBacktop']
@@ -87,8 +86,6 @@ declare module 'vue' {
ElTreeSelect: typeof import('element-plus/es')['ElTreeSelect'] ElTreeSelect: typeof import('element-plus/es')['ElTreeSelect']
ElUpload: typeof import('element-plus/es')['ElUpload'] ElUpload: typeof import('element-plus/es')['ElUpload']
ElWatermark: typeof import('element-plus/es')['ElWatermark'] ElWatermark: typeof import('element-plus/es')['ElWatermark']
ExampleImport: typeof import('./../views/demo/example/components/ExampleImport.vue')['default']
FileUpload: typeof import('./../components/Upload/FileUpload.vue')['default']
Frame: typeof import('./../components/Frame/index.vue')['default'] Frame: typeof import('./../components/Frame/index.vue')['default']
Fullscreen: typeof import('./../components/Fullscreen/index.vue')['default'] Fullscreen: typeof import('./../components/Fullscreen/index.vue')['default']
GithubCorner: typeof import('./../components/GithubCorner/index.vue')['default'] GithubCorner: typeof import('./../components/GithubCorner/index.vue')['default']
@@ -106,7 +103,6 @@ declare module 'vue' {
MenuItemContent: typeof import('./../layouts/components/Menu/components/MenuItemContent.vue')['default'] MenuItemContent: typeof import('./../layouts/components/Menu/components/MenuItemContent.vue')['default']
MenuSearch: typeof import('./../components/MenuSearch/index.vue')['default'] MenuSearch: typeof import('./../components/MenuSearch/index.vue')['default']
MixTopMenu: typeof import('./../layouts/components/Menu/MixTopMenu.vue')['default'] MixTopMenu: typeof import('./../layouts/components/Menu/MixTopMenu.vue')['default']
MultiImageUpload: typeof import('./../components/Upload/MultiImageUpload.vue')['default']
NavBar: typeof import('./../layouts/components/NavBar/index.vue')['default'] NavBar: typeof import('./../layouts/components/NavBar/index.vue')['default']
NavbarActions: typeof import('./../layouts/components/NavBar/components/NavbarActions.vue')['default'] NavbarActions: typeof import('./../layouts/components/NavBar/components/NavbarActions.vue')['default']
Notification: typeof import('./../components/Notification/index.vue')['default'] Notification: typeof import('./../components/Notification/index.vue')['default']
@@ -126,7 +122,6 @@ declare module 'vue' {
TableSelect: typeof import('./../components/TableSelect/index.vue')['default'] TableSelect: typeof import('./../components/TableSelect/index.vue')['default']
TagsView: typeof import('./../layouts/components/TagsView/index.vue')['default'] TagsView: typeof import('./../layouts/components/TagsView/index.vue')['default']
TextScroll: typeof import('./../components/TextScroll/index.vue')['default'] TextScroll: typeof import('./../components/TextScroll/index.vue')['default']
UserImport: typeof import('./../views/system/user/components/UserImport.vue')['default']
WangEditor: typeof import('./../components/WangEditor/index.vue')['default'] WangEditor: typeof import('./../components/WangEditor/index.vue')['default']
} }
export interface GlobalDirectives { export interface GlobalDirectives {