version: '3'
services:
# 模拟一个正常的mysql数据库
mysql8:
image: mysql:5.7
restart: always
container_name: mysql
ports:
- 3306:3306
volumes:
- ./databases/mysql/logs:/var/log/mysql
- ./databases/mysql/data:/var/lib/mysql
environment:
- MYSQL_ROOT_PASSWORD=wjht#%$347
# - MYSQL_ALLOW_EMPTY_PASSWORD=1
command:
--max_connections=1000
--character-set-server=utf8mb4
--collation-server=utf8mb4_general_ci
--default-authentication-plugin=mysql_native_password
--lower_case_table_names=1
networks:
SaasNet:
ipv4_address: 19.16.2.3
nacos:
image: nacos/nacos-server:v2.1.0
container_name: nacos
volumes:
- ./saastools/nacos/standalone-logs/:/home/nacos/logs
environment:
- db.url.0=jdbc:mysql://mysql8:3306/nacos?characterEncoding=utf8&connectTimeout=15000&socketTimeout=30000&autoReconnect=true&useUnicode=true&useSSL=false&serverTimezone=UTC&allowPublicKeyRetrieval=true
- spring.datasource.platform=mysql
- db.user.0=root
- db.password.0=wjht#%$347
- MODE=standalone
- nacos.core.auth.enabled=true
- nacos.core.auth.system.type=nacos
ports:
- "8848:8848"
- "9848:9848"
- "9849:9849"
depends_on:
- mysql8
restart: always
networks:
SaasNet:
ipv4_address: 19.16.2.4
networks:
SaasNet:
name: SaasNet
driver: bridge
ipam:
config:
- subnet: 19.16.2.0/24
gateway: 19.16.2.1
标签:compose,SaasNet,--,nacos,19.16,mysql,docker,true
From: https://www.cnblogs.com/sddll/p/18069994