version: “3.1”
services:
db:
container_name: mysql8
image: mysql
restart: always
environment:
TZ: Asia/Shanghai
MYSQL_ROOT_PASSWORD: MYSQL
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
–max_allowed_packet=128M
ports:
- 3306:3306
volumes:
- /home/daida/ruanjian_data/mysql-docker-data/logs:/var/log/mysql
- /home/daida/ruanjian_data/mysql-docker-data/mysql:/var/lib/mysql
#command是执行shell命令
#command: ls
#这个命令配合jar包的映射位置例如 /data/daida/xxx.jar : /data/xxx.jar执行的是后面的位置的jar左边只是映射
#entrypoint: java -jar /data/wxchat-0.0.1-SNAPSHOT.jar #启动容器后执行的命令
#注释掉用网页的方式登陆mysql
#adminer:
#image: adminer
#restart: always
#ports:
#- 33060:8080
docker-compose安装mysql8
最新推荐文章于 2024-07-16 20:30:00 发布