拉起 mysql 容器
docker-compose -f mysql.yml up -d
version: '3'
services:
mysql:
restart: always
image: mysql:5.7.34
container_name: mysql-57
volumes:
- /data/mysql/mydir:/mydir
- /data/mysql/datadir:/var/lib/mysql
- /data/mysql/conf/my.cnf:/etc/my.cnf
# 数据库还原目录 可将需要还原的sql文件放在这里
- /data/mysql/source:/docker-entrypoint-initdb.d
environment:
- MYSQL_ROOT_PASSWORD=Test0r@123
- MYSQL_DATABASE=zt_dcb
- TZ=Asia/Shanghai
- LANG=C.UTF-8
ports:
- 3306:3306
图片服务器配置 fastdfs.yml 信息
version: '3.7' services: tracker: #服务名称 image: delron/fastdfs #镜像 restart: always container_name: tracker #容器名称 ports: - 22122:22122 #端口映射宿主机:容器内端口 volumes: - /data/fdfs/tracker:/var/fdfs #目录映射 宿主机地址:容器内部地址 - /etc/localtime:/etc/localtime #目录映射 宿主机地址:容器内部地址 storage: image: delron/fastdfs container_name: storage environment: - TRACKER_SERVER=172.20.9.xxx:22122 #宿主机网络 ports: - 8888:8888 volumes: - /data/fdfs/storage:/var/fdfs - /etc/localtime:/etc/localtime depends_on: - tracker
zookeeper 配置文件 zookeeper-compose.yml
# zookeeper
version: '3'
services:
zookeeper:
image: zookeeper:latest
restart: always
container_name: zookeeper
ports:
- 2181:2181