nacos-docker/example/standalone-mysql.yaml

65 lines
1.7 KiB
YAML

version: "2"
services:
nacos:
image: nacos/nacos-server:latest
container_name: nacos-standalone-mysql
environment:
- PREFER_HOST_MODE=hostname
- MODE=standalone
- SPRING_DATASOURCE_PLATFORM=mysql
- MYSQL_MASTER_SERVICE_HOST=mysql-master
- MYSQL_MASTER_SERVICE_DB_NAME=nacos_devtest
- MYSQL_MASTER_SERVICE_PORT=3306
- MYSQL_SLAVE_SERVICE_HOST=mysql-slave
- MYSQL_SLAVE_SERVICE_PORT=3305
- MYSQL_MASTER_SERVICE_USER=nacos
- MYSQL_MASTER_SERVICE_PASSWORD=nacos
volumes:
- ./standalone-logs/:/home/nacos/logs
- ./init.d/custom.properties:/home/nacos/init.d/custom.properties
ports:
- "8848:8848"
- "9555:9555"
depends_on:
- mysql-slave
restart: on-failure
mysql-master:
container_name: mysql-master
image: nacos/nacos-mysql-master:latest
env_file:
- ../env/mysql-common.env
- ../env/mysql-master.env
volumes:
- ./mysql-master:/var/lib/mysql
ports:
- "3306:3306"
mysql-slave:
container_name: mysql-slave
image: nacos/nacos-mysql-slave:latest
env_file:
- ../env/mysql-common.env
- ../env/mysql-slave.env
volumes:
- ./mysql-slave:/var/lib/mysql
ports:
- "3305:3306"
depends_on:
- mysql-master
prometheus:
container_name: prometheus
image: prom/prometheus:latest
volumes:
- ./prometheus/prometheus-standalone.yaml:/etc/prometheus/prometheus.yml
ports:
- "9090:9090"
depends_on:
- nacos
restart: on-failure
grafana:
container_name: grafana
image: grafana/grafana:latest
ports:
- 3000:3000
restart: on-failure