Wire optional graceful announce-before-stop into the entrypoint (#651)

This commit is contained in:
Robert Morris authored and GitHub committed 2026-06-23 16:58:41 -05:00
1 parent c4d868eba7
commit 612fb2479e
3 files changed
+45 -1

No files matched your search

+2
View File
@@ -74,6 +74,8 @@ For Minecraft Java Edition you'll need to use this image instead:
- `MC_PACK` (no default): Path inside the container to a single archive file (e.g. `.mcpack`, `.mcworld`, `.mctemplate`, `.mcaddon`, or any zip) or to a directory with the same layout. At startup the archive is unpacked (or the directory is read): top-level `behavior_packs/` is merged into `behavior_packs/`, top-level `resource_packs/` into `resource_packs/`, and all other content (when `level.dat` is present) into `worlds/{LEVEL_NAME}`. For `.mcaddon` archives, which use root-level `data/` (behavior) and `resources/` (resource) folders instead of `behavior_packs/` and `resource_packs/`, these are detected and installed automatically using the pack UUID from each manifest as the folder name.
- `FORCE_WORLD_COPY` (default `false`): When `MC_PACK` contains a world (`level.dat`), set to `true` to remove and replace the existing `worlds/{LEVEL_NAME}` on every startup; otherwise the world is copied only when it does not exist.
- `FORCE_PACK_COPY` (default `false`): When `MC_PACK` contains `behavior_packs/` or `resource_packs/`, set to `true` to remove and replace existing pack folders with the same name on every startup; otherwise each pack is copied only when it does not already exist.
- `STOP_SERVER_ANNOUNCE_DELAY` (no default — disabled): opt into a graceful shutdown announcement. When set to a positive whole number of seconds, a heads-up line is written to the server console on container stop (`SIGTERM`); after that many seconds the server is sent `stop` (the usual clean-save shutdown). Unset or `0` keeps the previous behavior of stopping immediately. A second `SIGTERM` skips the remaining wait. Keep the value shorter than the container's stop grace period (e.g. `docker stop -t`, ECS `stopTimeout`, or an EC2 Spot interruption's ~2‑minute window) so the world save isn't cut short by `SIGKILL`.
- `STOP_SERVER_ANNOUNCE` (default `say Server shutting down in %delay% seconds`): the console line written as the announcement when `STOP_SERVER_ANNOUNCE_DELAY` is active. The `%delay%` token is replaced with the delay's whole-second value. Any server command works (e.g. a `say` or `tellraw`).
### Server Properties