version: '3.7' services: #mysql #服务名,自定义 mysql: image: mysql:5.7.25 container_name: mysql restart: always volumes: - /tmp/mysql/conf/hmy.cnf:/etc/mysql/conf.d/hmy.cnf - /tmp/mysql/data:/var/lib/mysql environment: MYSQL_ROOT_PASSWORD: root ports: - 3306:3306 redis: image: redis:6.2.4 container_name: redis restart: always ports: - 6379:6379