appbaseio / appbaseio/dejavu

Failure to propogate signals to Docker container

Open
#441 1 comment 1 reaction 3 assignees Claimed by @siddharthlatest View on GitHub
bug
Dominant language
JavaScript
Stars
8.5k
Forks
512
PR merge metrics
No merged PRs in 30d

Description

**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:
1. Run `docker run -p 1358:1358 --rm appbaseio/dejavu`
2. 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.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.