目录
首先如上我将dockers-compose.yaml放到了alibaba文件夹中,文件夹自行创建
version: "3"
services:
mysql:
container_name: mysql
image: mysql:5.7
environment:
- MYSQL_ROOT_PASSWORD=123456
volumes:
- /app/cloud/mysql/data:/var/lib/mysql
ports:
- "3306:3306"
restart: alwaysnacos:
image: nacos/nacos-server:1.4.1
container_name: nacos
hostname: nacos
restart: always
environment:
- MODE=standalone
- TZ=Asia/Shanghai
- NACOS_SERVER_PORT=8848
- SPRING_DATASOURCE_PLATFORM=mysql
- MYSQL_SERVICE_HOST=IP