Browse Source

修改docker配置

zq940222 2 months ago
parent
commit
7c494bf25b
1 changed files with 7 additions and 5 deletions
  1. 7 5
      docker/nacos/docker-compose.yml

+ 7 - 5
docker/nacos/docker-compose.yml

@@ -4,11 +4,13 @@ services:
     image: registry.cn-hangzhou.aliyuncs.com/72crm/nacos:1.2.1
     container_name: nacos
     environment:
-      - MODE=standalone
-      - TZ=Asia/Shanghai
-      - LANG=en_US.UTF-8
-    depends_on:
-      - db
+      SPRING_DATASOURCE_PLATFORM: mysql
+      MYSQL_SERVICE_HOST: localhost  # 替换为你的 MySQL 主机地址
+      MYSQL_SERVICE_PORT: 3306  # 替换为你的 MySQL 端口,默认为 3306
+      MYSQL_SERVICE_USER: root  # 替换为你的 MySQL 用户名
+      MYSQL_SERVICE_PASSWORD: password  # 替换为你的 MySQL 密码
+      MYSQL_SERVICE_DB_NAME: nacos  # 替换为你的数据库名称
+      PREFER_HOST_MODE: hostname
     volumes:
       - ./conf:/home/nacos/conf
       - ./log:/home/nacos/logs