2022-09-29 09:26:45 +00:00
|
|
|
version: "3.8"
|
2019-05-22 08:18:41 +00:00
|
|
|
services:
|
|
|
|
nacos1:
|
|
|
|
hostname: nacos1
|
|
|
|
container_name: nacos1
|
2021-03-21 07:13:03 +00:00
|
|
|
image: nacos/nacos-server:${NACOS_VERSION}
|
2019-05-22 08:18:41 +00:00
|
|
|
volumes:
|
|
|
|
- ./cluster-logs/nacos1:/home/nacos/logs
|
|
|
|
ports:
|
2023-03-11 09:36:59 +00:00
|
|
|
- "7848:7848"
|
2019-05-22 08:18:41 +00:00
|
|
|
- "8848:8848"
|
2023-03-21 11:51:06 +00:00
|
|
|
- "9868:9848"
|
|
|
|
- "9850:9849"
|
2019-05-22 08:18:41 +00:00
|
|
|
env_file:
|
|
|
|
- ../env/nacos-hostname.env
|
2019-10-25 12:51:45 +00:00
|
|
|
restart: always
|
2019-05-22 08:18:41 +00:00
|
|
|
depends_on:
|
2022-09-29 09:26:45 +00:00
|
|
|
mysql:
|
|
|
|
condition: service_healthy
|
2019-05-22 08:18:41 +00:00
|
|
|
|
|
|
|
nacos2:
|
|
|
|
hostname: nacos2
|
2021-03-21 07:13:03 +00:00
|
|
|
image: nacos/nacos-server:${NACOS_VERSION}
|
2019-05-22 08:18:41 +00:00
|
|
|
container_name: nacos2
|
|
|
|
volumes:
|
|
|
|
- ./cluster-logs/nacos2:/home/nacos/logs
|
|
|
|
ports:
|
2023-03-11 09:36:59 +00:00
|
|
|
- "7849:7848"
|
2019-05-22 08:18:41 +00:00
|
|
|
- "8849:8848"
|
2023-03-21 11:51:06 +00:00
|
|
|
- "9869:9848"
|
|
|
|
- "9851:9849"
|
2019-05-22 08:18:41 +00:00
|
|
|
env_file:
|
|
|
|
- ../env/nacos-hostname.env
|
2019-10-25 12:51:45 +00:00
|
|
|
restart: always
|
2019-05-22 08:18:41 +00:00
|
|
|
depends_on:
|
2022-09-29 09:26:45 +00:00
|
|
|
mysql:
|
|
|
|
condition: service_healthy
|
2019-05-22 08:18:41 +00:00
|
|
|
nacos3:
|
|
|
|
hostname: nacos3
|
2021-03-21 07:13:03 +00:00
|
|
|
image: nacos/nacos-server:${NACOS_VERSION}
|
2019-05-22 08:18:41 +00:00
|
|
|
container_name: nacos3
|
|
|
|
volumes:
|
|
|
|
- ./cluster-logs/nacos3:/home/nacos/logs
|
|
|
|
ports:
|
2023-03-11 09:36:59 +00:00
|
|
|
- "7850:7848"
|
2019-05-22 08:18:41 +00:00
|
|
|
- "8850:8848"
|
2023-03-21 11:51:06 +00:00
|
|
|
- "9870:9848"
|
|
|
|
- "9852:9849"
|
2019-05-22 08:18:41 +00:00
|
|
|
env_file:
|
|
|
|
- ../env/nacos-hostname.env
|
2019-10-25 12:51:45 +00:00
|
|
|
restart: always
|
2019-05-22 08:18:41 +00:00
|
|
|
depends_on:
|
2022-09-29 09:26:45 +00:00
|
|
|
mysql:
|
|
|
|
condition: service_healthy
|
2020-02-16 06:55:11 +00:00
|
|
|
mysql:
|
|
|
|
container_name: mysql
|
2022-09-29 09:26:45 +00:00
|
|
|
build:
|
|
|
|
context: .
|
|
|
|
dockerfile: ./image/mysql/5.7/Dockerfile
|
|
|
|
image: example/mysql:5.7
|
2019-05-22 08:18:41 +00:00
|
|
|
env_file:
|
2020-02-16 06:55:11 +00:00
|
|
|
- ../env/mysql.env
|
2019-05-22 08:18:41 +00:00
|
|
|
volumes:
|
2020-02-16 06:55:11 +00:00
|
|
|
- ./mysql:/var/lib/mysql
|
2019-05-22 08:18:41 +00:00
|
|
|
ports:
|
|
|
|
- "3306:3306"
|
2022-09-29 09:26:45 +00:00
|
|
|
healthcheck:
|
|
|
|
test: [ "CMD", "mysqladmin" ,"ping", "-h", "localhost" ]
|
|
|
|
interval: 5s
|
|
|
|
timeout: 10s
|
|
|
|
retries: 10
|
2019-10-25 12:51:45 +00:00
|
|
|
|