From 543414ec11f961323a0edb61f34219342af2d018 Mon Sep 17 00:00:00 2001 From: BrightChing Date: Thu, 25 Jul 2024 08:50:28 +0800 Subject: [PATCH] =?UTF-8?q?feat(nacos):=20=E9=85=8D=E7=BD=AENacos=202.4.0.?= =?UTF-8?q?1=E7=89=88=E6=9C=AC=E7=9A=84=E6=95=B0=E6=8D=AE=E5=92=8C?= =?UTF-8?q?=E7=8E=AF=E5=A2=83=E5=8F=98=E9=87=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 新增了nacos服务的data.yml配置文件,详细定义了Nacos的环境变量, 包括鉴权、端口、数据库连接等配置项。同时,docker-compose.yml文件 也进行了更新,以确保Nacos容器能够根据指定的环境变量正确运行。 通过这次配置更新,优化了Nacos的部署方式,使其更加灵活和易于管理。 --- apps/nacos/2.4.0.1/data.yml | 154 ++++++++++++++++++++++++++ apps/nacos/2.4.0.1/docker-compose.yml | 33 ++++++ 2 files changed, 187 insertions(+) create mode 100644 apps/nacos/2.4.0.1/data.yml create mode 100644 apps/nacos/2.4.0.1/docker-compose.yml diff --git a/apps/nacos/2.4.0.1/data.yml b/apps/nacos/2.4.0.1/data.yml new file mode 100644 index 0000000..a01a631 --- /dev/null +++ b/apps/nacos/2.4.0.1/data.yml @@ -0,0 +1,154 @@ +additionalProperties: + formFields: + - default: "true" + edit: true + envKey: NACOS_AUTH_ENABLE + labelEn: Enable Authentication + labelZh: 开启鉴权 + required: true + type: select + values: + - label: 开启 + value: "true" + - label: 关闭 + value: "false" + - default: 8848 + edit: true + envKey: PANEL_APP_PORT_HTTP + labelEn: Nacos run port + labelZh: Nacos 运行端口 + required: true + rule: paramPort + type: number + - default: 9848 + edit: true + envKey: PANEL_APP_PORT_COMMUNICATION + labelEn: Nacos communication port + labelZh: Nacos 通讯端口 + required: true + rule: paramPort + type: number + - default: "serverIdentity" + edit: true + envKey: NACOS_AUTH_IDENTITY_KEY + labelEn: Nacos auth identity key + labelZh: Nacos身份验证密钥键 + required: true + type: text + - default: "security" + edit: true + envKey: NACOS_AUTH_IDENTITY_VALUE + labelEn: Nacos auth identity value + labelZh: Nacos身份验证密钥值 + required: true + type: text + - default: "SecretKey012345678901234567890123456789012345678901234567890123456789" + edit: true + envKey: NACOS_AUTH_TOKEN + labelEn: Nacos auth token + labelZh: Nacos身份验证令牌 + required: true + type: text + - default: "mysql" + edit: true + envKey: SPRING_DATASOURCE_PLATFORM + labelEn: SPRING_DATASOURCE_PLATFORM + labelZh: Nacos使用数据库类型 + required: true + type: select + values: + - label: MYSQL + value: "mysql" + - label: SQLSERVER + value: "sqlserver" + - label: ORACLE + value: "oracle" + - label: POSTGRESQL + value: "postgresql" + - label: H2 + value: "h2" + - label: HSQL + value: "hsql" + - label: DERBY + value: "derby" + - label: DB2 + value: "db2" + - label: SQLITE + value: "sqlite" + - default: 10.2.2.12 + edit: true + envKey: MYSQL_SERVICE_HOST + labelEn: Nacos mysql host + labelZh: Nacos mysql 主机地址 + required: true + type: text + - default: 3306 + edit: true + envKey: MYSQL_SERVICE_PORT + labelEn: Nacos mysql port + labelZh: Nacos mysql 端口 + required: true + type: number + - default: "nacos" + edit: true + envKey: MYSQL_SERVICE_DB_NAME + labelEn: Nacos mysql database name + labelZh: Nacos mysql 数据库名称 + required: true + type: text + - default: "root" + edit: true + envKey: MYSQL_SERVICE_USER + labelEn: Nacos mysql username + labelZh: Nacos mysql 用户名 + required: true + type: text + - default: "123456" + edit: true + envKey: MYSQL_SERVICE_PASSWORD + labelEn: Nacos mysql password + labelZh: Nacos mysql 密码 + required: true + type: text + - default: "" + edit: true + envKey: NACOS_SERVER_IP + labelEn: IP can be specified in multi network card mode + labelZh: 多网卡模式下可以指定IP + required: false + type: text + - default: "2g" + edit: true + envKey: JVM_XMS + labelEn: JVM_XMS + labelZh: JVM_XMS + required: true + type: text + - default: "2g" + edit: true + envKey: JVM_XMX + labelEn: JVM_XMX + labelZh: JVM_XMX + required: true + type: text + - default: "1g" + edit: true + envKey: JVM_XMN + labelEn: JVM_XMN + labelZh: JVM_XMN + required: true + type: text + - default: "128m" + edit: true + envKey: JVM_MS + labelEn: JVM_MS + labelZh: JVM_MS + required: true + type: text + - default: "320m" + edit: true + envKey: JVM_MMS + labelEn: JVM_MMS + labelZh: JVM_MMS + required: true + type: text diff --git a/apps/nacos/2.4.0.1/docker-compose.yml b/apps/nacos/2.4.0.1/docker-compose.yml new file mode 100644 index 0000000..3266ae9 --- /dev/null +++ b/apps/nacos/2.4.0.1/docker-compose.yml @@ -0,0 +1,33 @@ +services: + nacos: + image: nacos/nacos-server:v2.4.0.1 + container_name: ${CONTAINER_NAME} + restart: always + environment: + - NACOS_AUTH_ENABLE=${NACOS_AUTH_ENABLE:-FALSE} + - PREFER_HOST_MODE=hostname + - MODE=standalone + - JVM_XMS=${JVM_XMS} + - JVM_XMX=${JVM_XMX} + - JVM_XMN=${JVM_XMN} + - JVM_MS=${JVM_MS} + - JVM_MMS=${JVM_MMS} + - NACOS_AUTH_IDENTITY_KEY=${NACOS_AUTH_IDENTITY_KEY} + - NACOS_AUTH_IDENTITY_VALUE=${NACOS_AUTH_IDENTITY_VALUE} + - NACOS_AUTH_TOKEN=${NACOS_AUTH_TOKEN} + - NACOS_SERVER_IP=${NACOS_SERVER_IP} + - SPRING_DATASOURCE_PLATFORM=${SPRING_DATASOURCE_PLATFORM} + - MYSQL_SERVICE_HOST=${MYSQL_SERVICE_HOST} + - MYSQL_SERVICE_PORT=${MYSQL_SERVICE_PORT} + - MYSQL_SERVICE_DB_NAME=${MYSQL_SERVICE_DB_NAME} + - MYSQL_SERVICE_USER=${MYSQL_SERVICE_USER} + - MYSQL_SERVICE_PASSWORD=${MYSQL_SERVICE_PASSWORD} + volumes: + - ./data/logs:/home/nacos/logs + - ./data/data:/home/nacos/data + ports: + - "${PANEL_APP_PORT_HTTP}:8848" + - "${PANEL_APP_PORT_COMMUNICATION}:9848" +networks: + 1panel-network: + external: true