Przeglądaj źródła

update docker config

root 1 rok temu
rodzic
commit
56560fee5a

+ 1 - 1
docker/deploy.sh

@@ -31,7 +31,7 @@ base(){
 
 # 启动程序模块(必须)
 modules(){
-	docker-compose up -d ruoyi-nginx ruoyi-gateway  ruoyi-modules-system
+	docker-compose up -d ruoyi-gateway  ruoyi-system
 }
 
 # 关闭所有环境/模块

+ 12 - 21
docker/docker-compose.yml

@@ -14,8 +14,8 @@ services:
       - "8848:8848"
       - "9848:9848"
       - "9849:9849"
-    depends_on:
-      - ruoyi-mysql
+    #depends_on:
+    #  - ruoyi-mysql
   ruoyi-mysql:
     container_name: ruoyi-mysql
     image: mysql:5.7
@@ -61,39 +61,30 @@ services:
       - ./nginx/conf/nginx.conf:/etc/nginx/nginx.conf
       - ./nginx/logs:/var/log/nginx
       - ./nginx/conf.d:/etc/nginx/conf.d
-#    depends_on:
-#      - ruoyi-gateway
-#    links:
-#      - ruoyi-gateway
   ruoyi-gateway:
     container_name: ruoyi-gateway
     build:
       context: ./ruoyi/gateway
       dockerfile: dockerfile
     ports:
-      - "8080:8080"
+      - "9150:9150"
+    volumes:
+      - /etc/localtime:/etc/localtime:ro
+      - /etc/hosts:/etc/hosts
     depends_on:
       - ruoyi-redis
     links:
       - ruoyi-redis
-#  ruoyi-auth:
-#    container_name: ruoyi-auth
-#    build:
-#      context: ./ruoyi/auth
-#      dockerfile: dockerfile
-#    ports:
-#      - "9200:9200"
-#    depends_on:
-#      - ruoyi-redis
-#    links:
-#      - ruoyi-redis
-  ruoyi-modules-system:
-    container_name: ruoyi-modules-system
+  ruoyi-system:
+    container_name: ruoyi-system
     build:
       context: ./ruoyi/modules/system
       dockerfile: dockerfile
     ports:
-      - "9201:9201"
+      - "9886:9886"
+    volumes:
+      - /etc/localtime:/etc/localtime:ro
+      - /etc/hosts:/etc/hosts
     depends_on:
       - ruoyi-redis
       - ruoyi-mysql

+ 7 - 0
docker/nacos/Dockerfile

@@ -0,0 +1,7 @@
+# 基础镜像
+FROM nacos/nacos-server
+# author
+MAINTAINER ruoyi
+
+# 复制conf文件到路径
+COPY ./conf/application.properties /home/nacos/conf/application.properties

+ 44 - 27
docker/nacos/conf/application.properties

@@ -1,32 +1,49 @@
-spring.datasource.platform=mysql
-db.num=1
-db.url.0=jdbc:mysql://localhost:3306/usky-config?characterEncoding=utf8&connectTimeout=1000&socketTimeout=3000&autoReconnect=true&useUnicode=true&useSSL=false&serverTimezone=UTC
-db.user= usky 
-db.password= Yt#75Usky 
-
-nacos.naming.empty-service.auto-clean=true
-nacos.naming.empty-service.clean.initial-delay-ms=50000
-nacos.naming.empty-service.clean.period-time-ms=30000
-
-management.endpoints.web.exposure.include=*
-
+# spring
+server.servlet.contextPath=${SERVER_SERVLET_CONTEXTPATH:/nacos}
+server.contextPath=/nacos
+server.port=${NACOS_APPLICATION_PORT:8848}
+server.tomcat.accesslog.max-days=30
+server.tomcat.accesslog.pattern=%h %l %u %t "%r" %s %b %D %{User-Agent}i %{Request-Source}i
+server.tomcat.accesslog.enabled=${TOMCAT_ACCESSLOG_ENABLED:false}
+server.error.include-message=ALWAYS
+# default current work dir
+server.tomcat.basedir=file:.
+#*************** Config Module Related Configurations ***************#
+### Deprecated configuration property, it is recommended to use `spring.sql.init.platform` replaced.
+#spring.datasource.platform=${SPRING_DATASOURCE_PLATFORM:}
+spring.sql.init.platform=${SPRING_DATASOURCE_PLATFORM:}
+nacos.cmdb.dumpTaskInterval=3600
+nacos.cmdb.eventTaskInterval=10
+nacos.cmdb.labelTaskInterval=300
+nacos.cmdb.loadDataAtStart=false
+db.num=${MYSQL_DATABASE_NUM:1}
+db.url.0=jdbc:mysql://${MYSQL_SERVICE_HOST}:${MYSQL_SERVICE_PORT:3306}/${MYSQL_SERVICE_DB_NAME}?${MYSQL_SERVICE_DB_PARAM:characterEncoding=utf8&connectTimeout=1000&socketTimeout=3000&autoReconnect=true&useSSL=false}
+db.user.0=${MYSQL_SERVICE_USER}
+db.password.0=${MYSQL_SERVICE_PASSWORD}
+### The auth system to use, currently only 'nacos' and 'ldap' is supported:
+nacos.core.auth.system.type=${NACOS_AUTH_SYSTEM_TYPE:nacos}
+### worked when nacos.core.auth.system.type=nacos
+### The token expiration in seconds:
+nacos.core.auth.plugin.nacos.token.expire.seconds=${NACOS_AUTH_TOKEN_EXPIRE_SECONDS:18000}
+### The default token:
+nacos.core.auth.plugin.nacos.token.secret.key=${NACOS_AUTH_TOKEN:}
+### Turn on/off caching of auth information. By turning on this switch, the update of auth information would have a 15 seconds delay.
+nacos.core.auth.caching.enabled=${NACOS_AUTH_CACHE_ENABLE:false}
+nacos.core.auth.enable.userAgentAuthWhite=${NACOS_AUTH_USER_AGENT_AUTH_WHITE_ENABLE:false}
+nacos.core.auth.server.identity.key=${NACOS_AUTH_IDENTITY_KEY:}
+nacos.core.auth.server.identity.value=${NACOS_AUTH_IDENTITY_VALUE:}
+## spring security config
+### turn off security
+nacos.security.ignore.urls=${NACOS_SECURITY_IGNORE_URLS:/,/error,/**/*.css,/**/*.js,/**/*.html,/**/*.map,/**/*.svg,/**/*.png,/**/*.ico,/console-fe/public/**,/v1/auth/**,/v1/console/health/**,/actuator/**,/v1/console/server/**}
+# metrics for elastic search
 management.metrics.export.elastic.enabled=false
 management.metrics.export.influx.enabled=false
+nacos.naming.distro.taskDispatchThreadCount=10
+nacos.naming.distro.taskDispatchPeriod=200
+nacos.naming.distro.batchSyncKeyCount=1000
+nacos.naming.distro.initDataRatio=0.9
+nacos.naming.distro.syncRetryDelay=5000
+nacos.naming.data.warmup=true
 
-server.tomcat.accesslog.enabled=true
-server.tomcat.accesslog.pattern=%h %l %u %t "%r" %s %b %D %{User-Agent}i %{Request-Source}i
-
-server.tomcat.basedir=
-
-nacos.security.ignore.urls=/,/error,/**/*.css,/**/*.js,/**/*.html,/**/*.map,/**/*.svg,/**/*.png,/**/*.ico,/console-ui/public/**,/v1/auth/**,/v1/console/health/**,/actuator/**,/v1/console/server/**
 
-nacos.core.auth.system.type=nacos
-nacos.core.auth.enabled=false
-nacos.core.auth.default.token.expire.seconds=18000
-nacos.core.auth.default.token.secret.key=SecretKey012345678901234567890123456789012345678901234567890123456789
-nacos.core.auth.caching.enabled=true
-nacos.core.auth.enable.userAgentAuthWhite=false
-nacos.core.auth.server.identity.key=serverIdentity
-nacos.core.auth.server.identity.value=security
 
-nacos.istio.mcp.server.enabled=false