-
Notifications
You must be signed in to change notification settings - Fork 119
/
docker-compose.yml
138 lines (137 loc) · 3.19 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
#
# FilePath: docker-compose.yml
# Author: yun.huang <[email protected]>
# Date: 2023-09-6 11:47:28
# LastEditors: yun.huang <[email protected]>
# LastEditTime: 2023-09-6 11:47:28
# Version: 1.0.1
# Copyright: 2023 YunYou Innovation Technology Co., Ltd. All Rights Reserved.
# Descripttion: 愿你开心每一天~
#
version: "3"
services:
super-mysql:
image: mysql:8.0.34
restart: always
container_name: super-mysql
hostname: super-mysql
environment:
# 数据库密码
MYSQL_ROOT_PASSWORD: SoulmateMysql110.
MYSQL_DATABASE: super_bot
TZ: Asia/Shanghai
ports:
- 3306:3306
logging:
driver: 'json-file'
options:
max-size: '1g'
volumes:
- /data/mysql/data:/var/lib/mysql
- ./my.cnf:/etc/mysql/my.cnf
- ./Java/sql/:/docker-entrypoint-initdb.d/
command: --max_connections=1000 --character-set-server=utf8mb4 --collation-server=utf8mb4_general_ci
networks:
super:
ipv4_address: 192.168.1.10
healthcheck:
test:
[
"CMD-SHELL",
"curl --silent 192.168.1.10:3306 >/dev/null || exit 1"
]
interval: 10s
timeout: 10s
retries: 3
super-redis:
image: redis:6.0.16-bullseye
depends_on:
- super-mysql
restart: always
container_name: super-redis
hostname: super-redis
environment:
TZ: Asia/Shanghai
ports:
- "6379:6379"
sysctls:
- net.core.somaxconn=1024
logging:
driver: 'json-file'
options:
max-size: '1g'
volumes:
- /data/redis/data:/data
- ./redis.conf:/etc/redis/redis.conf
command: /bin/sh -c "echo 'vm.overcommit_memory = 1' >> /etc/sysctl.conf && redis-server /etc/redis/redis.conf --appendonly yes"
privileged: true
networks:
super:
ipv4_address: 192.168.1.11
healthcheck:
test:
[
"CMD-SHELL",
"curl --silent 192.168.1.11:6379 >/dev/null || exit 1"
]
interval: 10s
timeout: 10s
retries: 3
super-java:
build:
context: ./Java
image: super-java:1.0.1
depends_on:
- super-redis
restart: always
container_name: super-java
hostname: super-java
environment:
TZ: Asia/Shanghai
ports:
- "8625:8625"
logging:
driver: 'json-file'
options:
max-size: '1g'
command: /bin/sh -c "java -jar /app/BDTH-SUPER-0.0.1-SNAPSHOT.jar"
networks:
super:
ipv4_address: 192.168.1.12
super-web:
build:
context: ./Web
image: super-web:1.0.1
depends_on:
- super-java
restart: always
container_name: super-web
hostname: super-web
environment:
TZ: Asia/Shanghai
ports:
- "80:80"
- "443:443"
logging:
driver: 'json-file'
options:
max-size: '1g'
command: /bin/sh -c "nginx -g 'daemon off;'"
networks:
super:
ipv4_address: 192.168.1.13
healthcheck:
test:
[
"CMD-SHELL",
"curl --silent 192.168.1.13:443 >/dev/null || exit 1"
]
interval: 10s
timeout: 10s
retries: 3
networks:
super:
ipam:
driver: default
config:
- subnet: "192.168.1.0/24"