-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-compose.yml
153 lines (138 loc) · 3.76 KB
/
docker-compose.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
version: '3.8'
# https://github.com/nacos-group/nacos-docker/blob/master/example/standalone-derby.yaml
services:
mysql:
image: mysql:${MYSQL_VERSION}
container_name: mysql
networks:
nacos_net:
ipv4_address: 172.16.238.11
ports:
- "3306:3306"
env_file:
# 账号密码都在这个文件里面设置
- ./env/mysql.env
command:
--default-authentication-plugin=mysql_native_password
--character-set-server=utf8mb4
--explicit_defaults_for_timestamp=true
--lower_case_table_names=1
volumes:
- ./mysql/data:/var/lib/mysql
# https://hub.docker.com/_/mysql Initializing a fresh instance
- ./mysql/mysql-schema.sql:/docker-entrypoint-initdb.d/nacos-mysql.sql
healthcheck:
test: [ "CMD", "mysqladmin" ,"ping", "-h", "localhost" ]
interval: 5s
timeout: 10s
retries: 10
redis:
image: redis:${REDIS_VERSION}
container_name: redis
environment:
TZ: Asia/Shanghai
command: redis-server --requirepass ${REDIS_PASSWORD}
networks:
nacos_net:
ipv4_address: 172.16.238.12
ports:
- "6379:6379"
volumes:
- ./redis/data/:/var/lib/redis
nacos-server:
image: nacos/nacos-server:${NACOS_VERSION}
container_name: nacos-server
networks:
nacos_net:
ipv4_address: 172.16.238.13
env_file:
- ./env/nacos-standlone-mysql.env
depends_on:
mysql:
condition: service_healthy
volumes:
- ./nacos/standalone-logs/:/home/nacos/logs
ports:
- "8848:8848"
- "9848:9848"
seata-server:
image: apache/seata-server:${SEATA_VERSION}
hostname: seata-server
networks:
nacos_net:
ipv4_address: 172.16.238.14
ports:
- "7091:7091"
- "8091:8091"
env_file:
- ./env/seata-server-nacos-mysql.env
volumes:
- ./seata-server/resources:/seata-server/resources
- ./seata-server/libs/mysql-connector-java-8.0.11.jar:/seata-server/libs/mysql-connector-java-8.0.11.jar
sentinel-server:
image: sentinel-server:latest
container_name: sentinel-server
build:
context: ./
dockerfile: ./image/sentinel/Dockerfile
args:
PORT: ${SENTINEL_PORT}
VERSION: ${SENTINEL_VERSION}
hostname: sentinel-server
networks:
nacos_net:
ipv4_address: 172.16.238.15
ports:
- "${SENTINEL_PORT}:${SENTINEL_PORT}"
logging:
driver: "json-file"
options:
max-size: "10m"
max-file: "1"
volumes:
- ./sentinel/root/logs:/root/logs
- ./sentinel/app-logs:/app-logs
# command: "--logging.file.path=/app-logs"
environment:
PORT: ${SENTINEL_PORT}
VERSION: ${SENTINEL_VERSION}
env_file:
- ./env/sentinel-server.env
mongodb:
image: mongo:${MONGODB_VERSION}
container_name: mongodb
networks:
nacos_net:
ipv4_address: 172.16.238.16
ports:
- "27017:27017"
environment:
MONGO_INITDB_ROOT_USERNAME: root
MONGO_INITDB_ROOT_PASSWORD: 123456
volumes:
- ./mongodb/data/db:/data/db
rabbitmq:
image: rabbitmq:${RABBITMQ_VERSION}
container_name: rabbitmq
volumes:
- ./rabbitmq/data/:/var/lib/rabbitmq/
- ./rabbitmq/logs/:/var/log/rabbitmq
ports:
- "5672:5672"
- "15672:15672"
environment:
# https://www.rabbitmq.com/docs/configure#supported-environment-variables
# https://www.rabbitmq.com/docs/configure
- TZ=Asia/Shanghai
- RABBITMQ_DEFAULT_USER=root # 默认管理员账号
- RABBITMQ_DEFAULT_PASS=123456 # 默认管理密码
networks:
nacos_net:
ipv4_address: 172.16.238.17
networks:
nacos_net:
driver: bridge
ipam:
driver: default
config:
- subnet: 172.16.238.0/24