feat(nacos): 配置Nacos 2.4.0.1版本的数据和环境变量

新增了nacos服务的data.yml配置文件,详细定义了Nacos的环境变量,
包括鉴权、端口、数据库连接等配置项。同时,docker-compose.yml文件
也进行了更新,以确保Nacos容器能够根据指定的环境变量正确运行。

通过这次配置更新,优化了Nacos的部署方式,使其更加灵活和易于管理。
This commit is contained in:
brightching 2024-07-25 08:50:28 +08:00
parent a04462fd10
commit 543414ec11
2 changed files with 187 additions and 0 deletions

154
apps/nacos/2.4.0.1/data.yml Normal file
View File

@ -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

View File

@ -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