version: "3"
services:
mysql:
restart: always
image: mysql:latest
container_name: cloud_mysql
volumes:
- /data01/mysql/datadir:/var/lib/mysql
- /data01/mysql/conf:/etc/mysql/conf.d
- /data01/mysql/logs:/logs
command:
--character-set-server=utf8mb4
--collation-server=utf8mb4_general_ci
--explicit_defaults_for_timestamp=true
--default-authentication-plugin=mysql_native_password
environment:
MYSQL_ROOT_PASSWORD: "root"
MYSQL_ROOT_USER: "root"
MYSQL_INITDB_SKIP_TZINFO: "Asia/Shanghai"
ports:
- 3306:3306
networks:
- cloudnet
nacos51:
restart: always
image: nacos/nacos-server
container_name: nacos51
depends_on:
- mysql
environment:
MODE: standalone
SPRING_DATASOURCE_PLATFORM: "mysql"
MYSQL_SERVICE_HOST: "cloud_mysql"
MYSQL_SERVICE_PORT: "3306"
MYSQL_SERVICE_USER: "root"
MYSQL_SERVICE_PASSWORD: "root"
MYSQL_SERVICE_DB_NAME: "nacos_config"
MYSQL_SERVICE_DB_PARAM: "useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8"
ports:
- 8851:8848
networks:
- cloudnet
networks:
cloudnet:
driver: bridge
标签:SERVICE,--,mysql,nacos,MYSQL,docker,root
From: https://www.cnblogs.com/zhouXX/p/16801211.html