forked from testnet0/testnet
-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.yml
170 lines (164 loc) · 4.81 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
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
networks:
testnet:
name: testnet
driver: bridge
ipam:
driver: default
config:
- gateway: ${SUBNET_PREFIX:?SUBNET_PREFIX required}.1
subnet: ${SUBNET_PREFIX}.0/24
driver_opts:
com.docker.network.bridge.name: testnet
services:
testnet-mysql:
image: ${IMAGE_PREFIX}/mysql:8.3
container_name: testnet-mysql
networks:
testnet:
ipv4_address: ${SUBNET_PREFIX}.2
environment:
MYSQL_ROOT_PASSWORD: ${MYSQL_PASSWORD}
MYSQL_ROOT_HOST: '%'
TZ: Asia/Shanghai
restart: always
command: --character-set-server=utf8mb4 --collation-server=utf8mb4_general_ci --explicit_defaults_for_timestamp=true --lower_case_table_names=1 --max_allowed_packet=128M --default-authentication-plugin=caching_sha2_password --max-connections=500
volumes:
- ./mysql_data:/var/lib/mysql
- ./db:/docker-entrypoint-initdb.d
ports:
- "33306:3306"
healthcheck:
test:
[
"CMD-SHELL",
"mysqladmin ping -h localhost -u root --password=$$MYSQL_ROOT_PASSWORD"
]
interval: 30s
timeout: 10s
retries: 3
start_period: 60s
testnet-redis:
image: ${IMAGE_PREFIX}/redis:5.0
container_name: testnet-redis
networks:
testnet:
ipv4_address: ${SUBNET_PREFIX}.3
command: redis-server --requirepass ${REDIS_PASSWORD}
ports:
- "36379:6379"
restart: always
healthcheck:
test: [ "CMD", "redis-cli", "ping" ]
interval: 30s
timeout: 10s
retries: 3
testnet-es:
image: ${IMAGE_PREFIX}/elasticsearch:7.10.0
container_name: testnet-es
networks:
testnet:
ipv4_address: ${SUBNET_PREFIX}.4
environment:
- node.name=elasticsearch
- discovery.type=single-node
- "ES_JAVA_OPTS=-Xms512m -Xmx512m"
volumes:
- ./es_data:/usr/share/elasticsearch/data
restart: always
healthcheck:
test:
[
"CMD-SHELL",
"curl --silent --fail localhost:9200/_cat/health || exit 1"
]
interval: 30s
timeout: 10s
retries: 3
testnet-server:
image: ${IMAGE_PREFIX}/testnet_server:latest
container_name: testnet-server
networks:
testnet:
ipv4_address: ${SUBNET_PREFIX}.5
environment:
- MYSQL_URL=jdbc:mysql://${SUBNET_PREFIX}.2:3306/jeecg-boot?characterEncoding=UTF-8&useUnicode=true&useSSL=false&tinyInt1isBit=false&allowPublicKeyRetrieval=true&serverTimezone=Asia/Shanghai
- MYSQL_USERNAME=root
- MYSQL_PASSWORD=${MYSQL_PASSWORD}
- REDIS_HOST=${SUBNET_PREFIX}.3
- REDIS_PORT=6379
- REDIS_PASSWORD=${REDIS_PASSWORD}
- ES_HOST=${SUBNET_PREFIX}.4:9200
- ES_PASSWORD=
- GPT_ENABLE=${GPT_ENABLE}
- GPT_KEY=${GPT_KEY}
- GPT_HOST=${GPT_HOST}
- TESTNET_API_TOKEN=${TESTNET_API_TOKEN}
depends_on:
testnet-mysql:
condition: service_healthy
testnet-redis:
condition: service_healthy
testnet-es:
condition: service_healthy
healthcheck:
test:
[
"CMD-SHELL",
"wget --spider --tries=1 --timeout=5 http://localhost:8080/jeecg-boot || exit 1"
]
interval: 90s
timeout: 10s
retries: 3
restart: always
testnet-frontend:
container_name: testnet-frontend
image: ${IMAGE_PREFIX}/testnet_frontend:latest
networks:
testnet:
ipv4_address: ${SUBNET_PREFIX}.6
ports:
- "8099:443"
depends_on:
testnet-mysql:
condition: service_healthy
testnet-redis:
condition: service_healthy
testnet-es:
condition: service_healthy
restart: always
healthcheck:
test:
[
"CMD-SHELL",
"curl -k --silent --fail https://localhost:443 || exit 1"
]
interval: 30s
timeout: 10s
retries: 3
testnet-client:
image: ${IMAGE_PREFIX}/testnet_client:latest
networks:
testnet:
ipv4_address: ${SUBNET_PREFIX}.7
container_name: testnet-client
volumes:
- ./client_data/tools:/testnet-client/tools
- ./client_data/results:/testnet-client/results
depends_on:
testnet-mysql:
condition: service_healthy
testnet-redis:
condition: service_healthy
testnet-es:
condition: service_healthy
environment:
- MYSQL_URL=jdbc:mysql://${SUBNET_PREFIX}.2:3306/jeecg-boot?characterEncoding=UTF-8&useUnicode=true&useSSL=false&tinyInt1isBit=false&allowPublicKeyRetrieval=true&serverTimezone=Asia/Shanghai
- MYSQL_USERNAME=root
- MYSQL_PASSWORD=${MYSQL_PASSWORD}
- REDIS_HOST=${SUBNET_PREFIX}.3
- REDIS_PASSWORD=${REDIS_PASSWORD}
- REDIS_PORT=6379
- TESTNET_CLIENT_VERSION=V1.2
- TESTNET_RESULT_PATH=/testnet-client/results/
- TESTNET_CLIENT_NAME=testnet-client-default
restart: always