-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose-soft.yaml
130 lines (128 loc) · 3.2 KB
/
docker-compose-soft.yaml
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
version: "3"
services:
nginx:
restart: always
image: nginx
container_name: nginx
ports:
- target: 80
published: 80
protocol: tcp
mode: host
- target: 8844
published: 8844
protocol: tcp
mode: host
- target: 8080
published: 8080
protocol: tcp
mode: host
networks:
softnetwork:
ipv4_address: 172.16.47.80
environment:
TZ: Asia/Shanghai
volumes:
# 配置文件/data/nginx/nginx.conf
- /data/nginx/conf.d:/etc/nginx/conf.d
- /data/nginx/nginx.conf:/etc/nginx/nginx.conf
- /data/nginx/logs:/var/log/nginx
- /data/nginx/html:/usr/share/nginx/html
mysql:
restart: always
image: mysql:5.7
container_name: mysql
networks:
softnetwork:
ipv4_address: 172.16.47.6
ports:
- target: 3306
published: 3306
protocol: tcp
mode: host
environment:
TZ: Asia/Shanghai
MYSQL_ROOT_PASSWORD: root
command:
- --character-set-server=utf8mb4
- --collation-server=utf8mb4_general_ci
volumes:
# 配置文件/data/mysql/conf/my.cnf
- /data/mysql/conf:/etc/mysql/conf.d
- /data/mysql/data:/var/lib/mysql
- /data/mysql/logs:/var/log/mysql
redis:
restart: always
image: redis:6.2.7
container_name: redis
networks:
softnetwork:
ipv4_address: 172.16.47.79
ports:
- target: 6379
published: 6379
protocol: tcp
mode: host
environment:
TZ: Asia/Shanghai
command:
- redis-server
- /usr/local/etc/redis/redis.conf
volumes:
# 配置文件/data/redis/conf/redis.conf(启动前配置)
- /data/redis/conf:/usr/local/etc/redis
- /data/redis/data:/data
- /data/redis/logs:/logs
nacos:
restart: always
image: nacos/nacos-server:2.0.3
container_name: nacos
network_mode: host
ports:
- target: 8848
published: 8848
protocol: tcp
mode: host
depends_on:
- mysql
environment:
PREFER_HOST_MODE: ip
MODE: cluster
NACOS_SERVERS: "192.168.47.112:8848,192.168.47.113:8848,192.168.47.114:8848"
NACOS_APPLICATION_PORT: 8848
SPRING_DATASOURCE_PLATFORM: mysql
MYSQL_SERVICE_HOST: 192.168.47.112
MYSQL_SERVICE_PORT: 3306
MYSQL_SERVICE_USER: root
MYSQL_SERVICE_PASSWORD: root
MYSQL_SERVICE_DB_NAME: micro-nacos
volumes:
- /data/nacos/logs:/home/nacos/logs
seata-server:
restart: always
image: seataio/seata-server:1.4.2
container_name: seata-server
networks:
softnetwork:
ipv4_address: 172.16.47.91
ports:
- target: 8091
published: 8091
protocol: tcp
mode: host
environment:
SEATA_PORT: 8091
SEATA_IP: 192.168.47.112
SEATA_CONFIG_NAME: file:/root/seata-config/registry
volumes:
# 配置文件/data/seata-server/config/registry.conf(启动前配置)
- /data/seata-server/config:/root/seata-config
# 自定义容器网络
networks:
softnetwork:
driver: bridge
ipam:
driver: default
config:
- subnet: 172.16.47.0/24
gateway: 172.16.47.1