修复工作

This commit is contained in:
2025-10-01 17:48:57 +08:00
parent b4e8cf5c33
commit 5e54e4ae62
4 changed files with 26 additions and 23 deletions

10
.env
View File

@@ -1,4 +1,4 @@
# MySQL数据库配置
# MySQL数据库配置远程MySQL
MYSQL_HOST=49.232.154.205
MYSQL_PORT=10080
MYSQL_DATABASE=fad_watch
@@ -10,9 +10,13 @@ REDIS_HOST=rtsp-redis
REDIS_PORT=6379
REDIS_PASSWORD=
# 服务器配置(重要!前端访问视频流使用)
# 服务器配置
SERVER_HOST=49.232.154.205
# Backend对外端口重要
BACKEND_EXTERNAL_PORT=10082
MEDIA_SERVER_EXTERNAL_PORT=10083
# 后端服务配置
BACKEND_HOST=rtsp-backend
BACKEND_PORT=8080
@@ -24,7 +28,7 @@ FRONTEND_PORT=10081
PYTHON_SERVICE_HOST=rtsp-python-service
PYTHON_SERVICE_PORT=8000
# MinIO配置
# MinIO配置(外部服务)
MINIO_ENABLED=true
MINIO_ENDPOINT=http://49.232.154.205:10900
MINIO_ACCESS_KEY=4EsLD9g9OM09DT0HaBKj

View File

@@ -48,6 +48,10 @@ services:
environment:
TZ: ${TZ}
SERVER_HOST: ${SERVER_HOST:-localhost}
SERVER_PORT: ${BACKEND_EXTERNAL_PORT}
SERVER_ADDRESS: 0.0.0.0
MEDIA_SERVER_PORT: ${MEDIA_SERVER_EXTERNAL_PORT}
MEDIA_SERVER_ADDRESS: 0.0.0.0
SPRING_DATASOURCE_URL: jdbc:mysql://${MYSQL_HOST}:${MYSQL_PORT}/${MYSQL_DATABASE}?useUnicode=true&characterEncoding=utf8&useSSL=false&serverTimezone=Asia/Shanghai&allowPublicKeyRetrieval=true
SPRING_DATASOURCE_USERNAME: ${MYSQL_USER}
SPRING_DATASOURCE_PASSWORD: ${MYSQL_PASSWORD}
@@ -59,7 +63,7 @@ services:
- backend-logs:/app/logs
- backend-upload:/app/upload
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:8080/actuator/health"]
test: ["CMD", "curl", "-f", "http://localhost:${BACKEND_EXTERNAL_PORT}/actuator/health"]
interval: 30s
timeout: 10s
retries: 5
@@ -69,19 +73,14 @@ services:
build:
context: ./rtsp-vue
dockerfile: Dockerfile
args:
BACKEND_API_URL: http://localhost:${BACKEND_PORT}
container_name: rtsp-frontend
restart: always
network_mode: "host"
depends_on:
backend:
condition: service_healthy
environment:
TZ: ${TZ}
NGINX_PORT: ${FRONTEND_PORT}
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:${FRONTEND_PORT}"]
test: ["CMD", "sh", "-c", "curl -f http://localhost:${FRONTEND_PORT}"]
interval: 30s
timeout: 10s
retries: 3

View File

@@ -10,9 +10,9 @@ server {
try_files $uri $uri/ /index.html;
}
# 后端API代理backend使用host网络
# 后端API代理backend使用host网络暴露10082端口
location /prod-api/ {
proxy_pass http://127.0.0.1:8080/;
proxy_pass http://127.0.0.1:10082/;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
@@ -24,7 +24,7 @@ server {
# WebSocket支持用于视频流
location /websocket/ {
proxy_pass http://127.0.0.1:8080/websocket/;
proxy_pass http://127.0.0.1:10082/websocket/;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
@@ -45,9 +45,9 @@ server {
proxy_set_header X-Forwarded-Proto $scheme;
}
# 视频流代理HTTP-FLVbackend使用host网络
# 视频流代理HTTP-FLVbackend使用host网络暴露10083端口
location /live {
proxy_pass http://127.0.0.1:8866;
proxy_pass http://127.0.0.1:10083;
proxy_http_version 1.1;
# 重要:禁用所有缓冲,实时传输视频流
@@ -75,7 +75,7 @@ server {
# 视频流代理HLS
location /hls {
proxy_pass http://127.0.0.1:8866;
proxy_pass http://127.0.0.1:10083;
proxy_http_version 1.1;
# HLS也需要禁用缓冲

View File

@@ -15,10 +15,10 @@ ruoyi:
# 开发环境配置
server:
# 服务器的HTTP端口默认为8080
port: 8080
# 监听本地地址,外网无法直接访问通过Nginx代理
address: ${SERVER_ADDRESS:127.0.0.1}
# 服务器的HTTP端口支持环境变量配置
port: ${SERVER_PORT:8080}
# 监听地址,支持环境变量配置
address: ${SERVER_ADDRESS:0.0.0.0}
servlet:
# 应用的访问路径
context-path: /
@@ -148,9 +148,9 @@ xss:
# 流媒体服务端口
mediasServer:
port: 8866
# 监听本地地址,外网无法直接访问通过Nginx代理
address: ${MEDIA_SERVER_ADDRESS:127.0.0.1}
port: ${MEDIA_SERVER_PORT:8866}
# 监听地址,支持环境变量配置
address: ${MEDIA_SERVER_ADDRESS:0.0.0.0}
# 网络超时15秒
netTimeout: 15000000
# 读写超时15秒