escapingnetwork / core-keeper-dedicated

Dockerfile for automated build of a Core Keeper Dedicated Server
https://hub.docker.com/r/escaping/core-keeper-dedicated
MIT License
97 stars 26 forks source link

feat(Dockerfile): add tini for init handling #46

Closed solareon closed 2 weeks ago

solareon commented 2 weeks ago

Adds tini to support passing through application signals allowing server to stop without waiting for timeout.

Micke90s commented 2 weeks ago

Yes, the stop signal is not handled correctly now.

In launch.sh the trap kill_corekeeperserver EXIT should run when the container receives the stop signal. Unfortunately, the trap is not called when the container is stopped via docker stop or docker compose down.

This is still an open problem as part of issue #22 \ I had no time yet to further investigate this problem.

solareon commented 2 weeks ago

So adding tini to the container/entrypoint fixes all of that. This PR adds that. When you stop the container the container stops instantly as the sigterm is passed to the forked process at https://github.com/escapingnetwork/core-keeper-dedicated/blob/45c47d2e971c2320dc4e039250cb15cd9ef83800/launch.sh#L72.