diff --git a/.env b/.env index f9ee99c..02bdd8a 100644 --- a/.env +++ b/.env @@ -1,9 +1,9 @@ -# MySQL数据库配置(使用本地MySQL,不在Docker中部署) -MYSQL_HOST=localhost -MYSQL_PORT=3306 +# MySQL数据库配置(使用远程MySQL,通过IP地址直接连接) +MYSQL_HOST=49.232.154.205 +MYSQL_PORT=10080 MYSQL_DATABASE=fad_watch MYSQL_USER=root -MYSQL_PASSWORD=root +MYSQL_PASSWORD=Fuande@666 # Redis配置 REDIS_HOST=rtsp-redis @@ -29,8 +29,4 @@ MINIO_SECRET_KEY=05SFC5fleqTnaLRYBrxHiphMFYbGX5nYicj0WCHA MINIO_BUCKET=rtsp # 时区配置 -TZ=Asia/Shanghai - -# 备注: -# - MySQL使用本地数据库,Docker容器通过host.docker.internal连接 -# - MinIO使用外部已部署的服务 +TZ=Asia/Shanghai \ No newline at end of file diff --git a/docker-compose.yml b/docker-compose.yml index f4af6d2..c9c5cab 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -41,8 +41,6 @@ services: dockerfile: ruoyi-admin/Dockerfile container_name: ${BACKEND_HOST} restart: always - extra_hosts: - - "host.docker.internal:host-gateway" depends_on: redis: condition: service_healthy @@ -50,7 +48,7 @@ services: condition: service_started environment: TZ: ${TZ} - SPRING_DATASOURCE_URL: jdbc:mysql://host.docker.internal:${MYSQL_PORT}/${MYSQL_DATABASE}?useUnicode=true&characterEncoding=utf8&useSSL=false&serverTimezone=Asia/Shanghai&allowPublicKeyRetrieval=true + 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} SPRING_DATA_REDIS_HOST: ${REDIS_HOST} @@ -74,7 +72,7 @@ services: context: ./rtsp-vue dockerfile: Dockerfile args: - BACKEND_API_URL: http://${BACKEND_HOST}:${BACKEND_PORT} + BACKEND_API_URL: http://localhost:${BACKEND_PORT} container_name: rtsp-frontend restart: always ports: