Failure to propogate signals to Docker container
Describe the bug When running dejavu in a docker container in the foreground, SIGINT and SIGTERM signals are not propagating to the process.
Dejavu Version Docker image: latest (as of 4/11/22)
To Reproduce Steps to reproduce the behavior:
- Run
docker run -p 1358:1358 --rm appbaseio/dejavu - Press Ctrl+C
Expected behavior The container should exit after pressing Ctrl+C
Desktop (please complete the following information):
- OS: MacOS 12.3.1
Additional context
This is likely due to not using the exec syntax when running the CMD for node. This is a good article explaining it https://hynek.me/articles/docker-signals/
The likely fix is to use this form CMD ["node", "packages/dejavu-main/server.js"] in the Dockerfile. This is important because it enables any program that orchestrates running multiple processes (for example running elasticsearch, dejavu and and app) to safely kill this running container at shutdown time. It also allows the docker stop command to safely stop the dejavu server without using a force kill.
I ran into a yarn build error when trying to run docker build locally otherwise I would have put up a PR with the fix.