Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix slow Docker container termination #491

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

gabe565
Copy link

@gabe565 gabe565 commented Feb 19, 2025

Hey! This project is a lot of fun, but I've noticed that the Docker containers are slow to terminate. When I stop them, the containers keep running up until Docker decides to kill them. This is due to the shell scripts being run as PID 0, and not passing signals to node.

This PR changes the startup scripts to use exec, which replaces the script PID with the command it runs. This means when Docker sends a SIGTERM, it will go directly to node, immediately telling it to exit.

I also went ahead and added set -e which makes a script exit if a command fails. This removes the need for chaining &&.

@gabe565 gabe565 force-pushed the fix-docker-slow-termination branch from f9f8113 to 0647914 Compare February 19, 2025 10:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant