Handle SIGTERM to stop Minecraft gracefully

- Set up SIGTERM signal trap to invoke stop_server
- Ensure proper process exit and cleanup after the server stops
- Create makefile to build, clean, and install builds
This commit is contained in:
2024-05-15 03:22:34 -04:00
parent 381bd9eeff
commit 297902a686
6 changed files with 99 additions and 19 deletions

View File

@@ -1,6 +1,3 @@
volumes:
minecraft:
services:
minecraft:
build:
@@ -12,12 +9,10 @@ services:
image: ${IMAGE:-minecraft}:${TAG:-latest}
ports:
- "0.0.0.0:25565:25565"
#volumes:
# - minecraft:/app/world
environment:
EULA: "${EULA:-false}"
DEBUG: "${DEBUG:-false}"
JVM_OPTS: "-Xms1G -Xmx2G"
JVM_OPTS: "${JAVA_OPTS:--Xms1G -Xmx2G}"
SETTINGS_gamemode: "${GAMEMODE:-survival}"
SETTINGS_hardcore: "${HARDCORE:-false}"
SETTINGS_motd: "${MOTD:-A Minecraft Server}"