bastilimbach / docker-MagicMirror

Docker image for the Magic Mirror 2 project by Michael Teeuw.
https://hub.docker.com/r/bastilimbach/docker-magicmirror/
MIT License
185 stars 54 forks source link

Use exec to start the main program #22

Closed michaelarnauts closed 5 years ago

michaelarnauts commented 5 years ago

When restarting the docker container, it always takes 10 seconds to restart since the SIGTERM message isn't passed to node. After 10 seconds, a SIGKILL will be send to forcefully terminate the container.

This PR uses exec to start the program in the init script. This helps with signal handling so a SIGTERM is passed trough to the node app. This is only one part of the fix, since currently the node app is ignoring SIGTERM messages (what it shouldn't). I will also open a fix there.

See for more information: https://hynek.me/articles/docker-signals/

bastilimbach commented 5 years ago

Wow thank you. Didn’t knew of that one. Great article also 👍