forked from testnet0/testnet
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-compose-server.yml
112 lines (109 loc) · 3.12 KB
/
docker-compose-server.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
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:
- ./data/mysql_data:/var/lib/mysql
- ./db:/docker-entrypoint-initdb.d
healthcheck:
test:
[
"CMD-SHELL",
"mysqladmin ping -h localhost -u root --password=$$MYSQL_ROOT_PASSWORD"
]
interval: 30s
timeout: 5s
retries: 10
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}
restart: always
healthcheck:
test: ["CMD", "redis-cli", "-a", "${REDIS_PASSWORD}", "ping"]
interval: 30s
timeout: 1s
retries: 3
testnet-server:
image: ${IMAGE_PREFIX}/testnet_server
container_name: testnet-server
ulimits:
nofile:
soft: 65536
hard: 65536
volumes:
- ./data/server_data:/testnet-server/lucene
networks:
testnet:
ipv4_address: ${SUBNET_PREFIX}.4
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}
- AI_ENABLE=${AI_ENABLE}
- AI_MODEL=${AI_MODEL}
- AI_API_KEY=${AI_API_KEY}
- AI_API_HOST=${AI_API_HOST}
- TESTNET_API_TOKEN=${TESTNET_API_TOKEN}
- TESTNET_GRPC_TOKEN=${TESTNET_GRPC_TOKEN}
depends_on:
testnet-mysql:
condition: service_healthy
testnet-redis:
condition: service_healthy
healthcheck:
test:
[
"CMD-SHELL",
"nc -z -w 5 localhost 8080 || exit 1"
]
interval: 30s
timeout: 1s
retries: 3
start_period: 60s
restart: always
testnet-frontend:
container_name: testnet-frontend
image: ${IMAGE_PREFIX}/testnet_frontend
networks:
testnet:
ipv4_address: ${SUBNET_PREFIX}.5
ports:
- "8099:443"
restart: always
healthcheck:
test:
[
"CMD-SHELL",
"curl -k --silent --fail https://localhost:443 || exit 1"
]
interval: 30s
timeout: 1s
retries: 3