Add --stop-timeout to the run command
Joly0 opened this issue · comments
As described here https://docs-stage.docker.com/engine/reference/commandline/run/#stop-timeout it is possible to add --stop-timeout to define a custom timeout for the docker container, that "overrides" the default 10 seconds.
Some extra information on how this got implemented in other projects is found here https://youtrack.jetbrains.com/issue/JT-61434
This should fix the problem, that modules/instances are not always correctly shutdowned but rather terminated, as soon as the default stop-timeout is reached after 10 seconds. Though i am not sure, if --stop-signal is needed and what it should be set to ( i guess it needs to be SIGTERM as thats the signal that is handled internally in the docker container).
So to sum this up, an adjusted docker run command should look like this:
docker run -d \
--name=amp \
--mac-address="02:42:AC:XX:XX:XX" \
-e UID=1000 \
-e GID=1000 \
-e TZ=Etc/UTC \
-e USERNAME=admin \
-e PASSWORD=admin \
-e AMP_LICENCE=00000000-0000-0000-0000-000000000000 \
-e AMP_MODULE=ADS \
-p 8080:8080 \
-p 25565:25565 `#optional` \
-v path_to_appdata:/home/amp/.ampdata \
--restart unless-stopped \
--stop-timeout=60 \
--stop-signal=SIGTERM \
mitchtalmadge/amp-dockerized:latest
Stop timeout should be high enough with 60 seconds to gracefully shutdown all running instances, but it could also be decreased to 45 or even further down
And it would be great, to have a consolidated default docker run command for a basic amp setup into the documentation and maybe split up the readme into the github wiki feature and leave only 100% needed information in the readme