-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-compose.yml
336 lines (305 loc) · 9.98 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
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
version: '3.7'
####################################################################
# Garbage Collection Options #
####################################################################
x-velocity-gc-g1gc: &velocity-gc-g1gc
# https://docs.papermc.io/velocity/tuning#tune-your-startup-flags
JVM_OPTS: >-
-XX:+UseG1GC
-XX:G1HeapRegionSize=4M
-XX:+UnlockExperimentalVMOptions
-XX:+ParallelRefProcEnabled
-XX:+AlwaysPreTouch
-XX:MaxInlineLevel=15
x-velocity-gc-zgc: &velocity-gc-zgc
# https://krusic22.com/2020/03/25/higher-performance-crafting-using-jdk11-and-zgc
JVM_OPTS: >-
-XX:+UnlockExperimentalVMOptions
-XX:-UseG1GC
-XX:+UseZGC
-XX:+DisableExplicitGC
-XX:-UseParallelGC
-XX:+ParallelRefProcEnabled
-XX:MaxInlineLevel=15
-XX:+AlwaysPreTouch
# https://kstefanj.github.io/2021/05/19/large-pages-and-java.html
# -Xlog:gc+init
# -Xlog:pagesize
# -XX:+UseTransparentHugePages
x-minecraft-gc-aikars: &minecraft-gc-aikars
# https://aikar.co/2018/07/02/tuning-the-jvm-g1gc-garbage-collector-flags-for-minecraft/
USE_AIKAR_FLAGS: true
# https://kstefanj.github.io/2021/05/19/large-pages-and-java.html
#JVM_XX_OPTS: >-
# -Xlog:gc+init
# -Xlog:pagesize
# -XX:+UseTransparentHugePages
x-minecraft-gc-g1gc: &minecraft-gc-g1gc
# https://github.com/brucethemoose/Minecraft-Performance-Flags-Benchmarks
JVM_XX_OPTS: >-
-XX:+UseG1GC
-XX:MaxGCPauseMillis=130
-XX:+UnlockExperimentalVMOptions
-XX:+DisableExplicitGC
-XX:G1NewSizePercent=28
-XX:G1HeapRegionSize=16M
-XX:G1ReservePercent=20
-XX:G1MixedGCCountTarget=3
-XX:InitiatingHeapOccupancyPercent=10
-XX:G1MixedGCLiveThresholdPercent=90
-XX:G1RSetUpdatingPauseTimePercent=0
-XX:SurvivorRatio=32
-XX:MaxTenuringThreshold=1
-XX:G1SATBBufferEnqueueingThresholdPercent=30
-XX:G1ConcMarkStepDurationMillis=5
-XX:G1ConcRSHotCardLimit=16
-XX:G1ConcRefinementServiceIntervalMillis=150
# -Xlog:gc+init
# -Xlog:pagesize
# -XX:+AlwaysPreTouch
# -XX:+UseTransparentHugePages
x-minecraft-gc-zgc: &minecraft-gc-zgc
# https://krusic22.com/2020/03/25/higher-performance-crafting-using-jdk11-and-zgc/
JVM_XX_OPTS: >-
-XX:+UnlockExperimentalVMOptions
-XX:+DisableExplicitGC
-XX:-UseParallelGC
-XX:-UseG1GC
-XX:+UseZGC
# https://kstefanj.github.io/2021/05/19/large-pages-and-java.html
# -Xlog:gc+init
# -Xlog:pagesize
# -XX:+AlwaysPreTouch
# -XX:+UseTransparentHugePages
####################################################################
# Minecraft Options #
####################################################################
x-minecraft-options: &minecraft-options
#DEBUG: true
EULA: true
# https://github.com/itzg/docker-minecraft-server/blob/master/README.md#replacing-variables-inside-configs
# REPLACE_ENV_IN_PLACE: false
# REPLACE_ENV_DURING_SYNC: true
# REPLACE_ENV_SUFFIXES: yml,yaml,txt,cfg,conf,properties,hjson,json,tml,toml
# REPLACE_ENV_VARIABLES_EXCLUDES
# REPLACE_ENV_VARIABLES_EXCLUDE_PATHS:
# REPLACE_ENV_VARIABLES: true
# REPLACE_ENV_VARIABLE_PREFIX: CRAFTERSMC_
# REPLACE_ENV_VARIABLES_EXCLUDE_PATHS: >-
# /data/.cache
# /data/.fabric
# /data/audioplayer_uploads
# /data/crash-reports
# /data/datapacks
# /data/dynmap/web
# /data/libraries
# /data/logs
# /data/mods
# /data/resourcepacks
# /data/syncmatics
# /data/versions
# /data/world
# https://github.com/itzg/docker-minecraft-server/blob/master/README.md#optional-plugins-mods-and-config-attach-points
# REMOVE_OLD_MODS: true
# REMOVE_OLD_MODS_INCLUDE: "*.jar"
# REMOVE_OLD_MODS_DEPTH: 1
# Server Options
TYPE: FABRIC
VERSION: 1.19.2
PACKWIZ_URL: ${PACKWIZ_URL:-https://modpack.craftersmc.com/pack.toml}
UID: ${PUID}
GID: ${PGID}
TZ: America/Los_Angeles
# server.properties overrides
OVERRIDE_SERVER_PROPERTIES: true
MOTD: CraftersMC
LEVEL_TYPE: normal
MAX_WORLD_SIZE: 30000
SPAWN_PROTECTION: 30000
DIFFICULTY: hard
VIEW_DISTANCE: 8
SIMULATION_DISTANCE: 6
MAX_PLAYERS: 50
OPS: Chaws
ENFORCE_WHITELIST: true
ENABLE_WHITELIST: true
USE_NATIVE_TRANSPORT: true
MAX_TICK_TIME: -1
ENABLE_RCON: true
RCON_PASSWORD: ${RCON_PASSWORD}
FABRIC_PROXY_SECRET: ${VELOCITY_FORWARDING_SECRET}
#STOP_SERVER_ANNOUNCE_DELAY: 5
SNOOPER_ENABLED: false
# Disable network compression between the MC server and the proxy.
# The proxy will handle the compression.
NETWORK_COMPRESSION_THRESHOLD: -1
# Garbage Collection
<<: *minecraft-gc-aikars
# <<: *minecraft-gc-g1gc
# <<: *minecraft-gc-shenandoah
# <<: *minecraft-gc-zgc
# LuckPerms
LUCKPERMS_STORAGE_METHOD: mysql
LUCKPERMS_DATA_ADDRESS: db
LUCKPERMS_DATA_DATABASE: craftersmc-luckperms
LUCKPERMS_DATA_USERNAME: ${SQL_USER}
LUCKPERMS_DATA_PASSWORD: ${SQL_PASSWORD}
# Ledger
LEDGER_DATABASE_EXTENSIONS_DATABASE: mysql
LEDGER_DATABASE_EXTENSIONS_USERNAME: ${SQL_USER}
LEDGER_DATABASE_EXTENSIONS_PASSWORD: ${SQL_PASSWORD}
# RCON
# https://pcal43.github.io/fastback/
RCON_CMDS_STARTUP: |-
/dynmap pause full
/gamerule doFireTick false
/lp user Chaws permission set luckperms.* true
/backup set-shutdown-action full-gc
/backup set-autoback-action local
/backup set-retention daily 3
/backup set-autoback-wait 30
/backup enable
# RCON_CMDS_FIRST_CONNECT: |-
# /dynmap pause full
# RCON_CMDS_LAST_DISCONNECT: |-
# /dynmap pause none
# RCON_CMDS_ON_CONNECT: |-
# team join New @a[team=]
services:
proxy:
image: itzg/bungeecord:java17
container_name: craftersmc-proxy
restart: on-failure:3 # 3 retries
ports:
- "25565:25577"
volumes:
- ${ROOT_PATH}/proxy/server:/server
- ${ROOT_PATH}/proxy/plugins:/plugins
- ${ROOT_PATH}/proxy/config:/config
environment:
TYPE: VELOCITY
MEMORY: ${PROXY_MEMORY:-2G}
VELOCITY_FORWARDING_SECRET: ${VELOCITY_FORWARDING_SECRET}
# <<: *velocity-gc-g1gc
<<: *velocity-gc-zgc
survival:
image: itzg/minecraft-server:latest
container_name: craftersmc-survival
restart: on-failure:3 # 3 retries
# fastback mod is setup to do a full backup + gc on shutdown
stop_grace_period: 2m
depends_on:
- db
ports:
- "25568:25565" # Server: survival.craftersmc.com
- "8125:8080" # Map: https://map.craftersmc.com
- "24454:24454/udp" # SimpleVoiceChat
- "25575:25575" # RCON
volumes:
- ${ROOT_PATH}/servers/survival:/data
environment:
<<: *minecraft-options
MEMORY: ${SURVIVAL_MEMORY:-12G}
# LuckPerms
LUCKPERMS_SERVER: survival
# Ledger
LEDGER_DATABASE_EXTENSIONS_URL: db/craftersmc-survival-ledger
creative:
image: itzg/minecraft-server:latest
container_name: craftersmc-creative
restart: on-failure:3 # 3 retries
# fastback mod is setup to do a full backup + gc on shutdown
stop_grace_period: 2m
depends_on:
- db
ports:
- "25569:25565" # Server: creative.craftersmc.com
- "8126:8080" # Map
- "24455:24454/udp" # SimpleVoiceChat
- "25576:25575" # RCON
volumes:
- ${ROOT_PATH}/servers/creative:/data
environment:
<<: *minecraft-options
MEMORY: ${CREATIVE_MEMORY:-6G}
# server.properties overrides
MOTD: CraftersMC Creative
LEVEL_TYPE: flat
DIFFICULTY: hard
ALLOW_FLIGHT: true
SPAWN_NPCS: false
SPAWN_MONSTERS: false
SPAWN_ANIMALS: false
ANNOUNCE_PLAYER_ACHIEVEMENTS: false
ALLOW_NETHER: false
GENERATOR_SETTINGS: >-
{
"flat_world_options": "bedrock,62*dirt,1grass_block;plains"
}
# LuckPerms
LUCKPERMS_SERVER: creative
# Ledger
LEDGER_DATABASE_EXTENSIONS_URL: db/craftersmc-creative-ledger
stats:
image: jeromelabidurie/minecraftstats
container_name: craftersmc-stats
restart: on-failure:3 # 3 retries
depends_on:
- survival
ports:
- "8890:8000" # https://stats.craftersmc.com
volumes:
- ${ROOT_PATH}/servers/survival:/minecraft
- ${ROOT_PATH}/servers/survival/stats:/config
environment:
MS_UPDATE_FREQ: 1 # delay (in minutes) between updates of MinecraftStats database
db:
image: mariadb:latest
container_name: craftersmc-db
restart: on-failure:3 # 3 retries
ports:
- "3306:3306"
volumes:
- ${ROOT_PATH}/sql:/var/lib/mysql
environment:
MARIADB_USER: ${SQL_USER}
MARIADB_PASSWORD: ${SQL_PASSWORD}
MARIADB_ROOT_PASSWORD: ${SQL_ROOT_PASSWORD}
MARIADB_DATABASE: craftersmc
MARIADB_AUTO_UPGRADE: true
# dbgui:
# image: dbeaver/cloudbeaver:latest
# container_name: craftersmc-db-gui
# restart: on-failure:3 # 3 retries
# depends_on:
# - db
# ports:
# - "8978:8978"
# volumes:
# - ${ROOT_PATH}/sql/cloudbeaver:/opt/cloudbeaver/workspace
# cache:
# image: redis/redis-stack:latest
# container_name: craftersmc-cache
# restart: on-failure:3 # 3 retries
# ports:
# - "6379:6379" # Redis
# - "8001:8001" # RedisInsight: http://localhost:8001
# volumes:
# - ${ROOT_PATH}/cache:/data
rcon:
image: itzg/rcon
container_name: craftersmc-rcon
restart: on-failure:3 # 3 retries
depends_on:
- survival
- creative
ports:
- "4326:4326" # WebUI: https://rcon.craftersmc.com
- "4327:4327" # WebSocket
volumes:
- ${ROOT_PATH}/rcon:/opt/rcon-web-admin/db
environment:
RWA_ADMIN: true
RWA_USERNAME: ${RCON_USERNAME}
RWA_PASSWORD: ${RCON_PASSWORD}
RWA_ENV: false