version: '3'
services:
mysql: #指定容器名称
restart: always # 代表知道docker 启动那么这个容器就跟着一起启动
image: mysql:5.7 #指定镜像
container_name: mysql5.7 # 指定镜像名称
ports:
- 3306:3306 # 指定端口号的映射
environment:
TZ: Asia/Shanghai
MYSQL_ROOT_PASSWORD: 123456
command:
--default-authentication-plugin=mysql_native_password
--character-set-server=utf8mb4
--collation-server=utf8mb4_general_ci
--explicit_defaults_for_timestamp=true
--lower_case_table_names=1
--innodb-adaptive-hash-index
nacos:
restart: always
image: nacos/nacos-server
container_name: nacos
ports:
- 8848:8848
environment:
MODE: standalone
网友评论