Docker Compose分别安装tomcat和mysql
- 创建项目目录
mkdir –p /usr/local/docker/qfjy_exam
- 该当目录下创建docker-compose.yml
vim docker-compose.yml
Mysql参考:https://www.cnblogs.com/mmry/p/8812599.html
分别查看安装tomcat和mysql的数据卷信息。
创建项目目录
mkdir –p /usr/local/docker/mysql
数据库
/var/lib/docker/volumes
version: '3' services: mysql: restart: always image: mysql:5.6 container_name: mysql5.6 ports: - 3306:3306 environment: TZ: Asia/Shanghai MYSQL_ROOT_PASSWORD: 密码 volumes: - mysql-data:/var/lib/mysql
volumes: mysql-data: |