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

17
Makefile Normal file
View File

@@ -0,0 +1,17 @@
CONTAINER = minecraft-minecraft-1
.PHONY: default build clean install
default: build
build:
docker compose build
clean:
rm -f screenlog.0
docker compose down --rmi all
docker builder prune -f
install: build
touch screenlog.0
docker compose up -d && \
docker logs -f $(CONTAINER)