Skip to content

Conversation

@sugtao4423
Copy link

@sugtao4423 sugtao4423 commented Nov 29, 2025

Problem

docker compose down takes 10 seconds and Docker forcefully kills the container because graceful shutdown doesn't work.

Root cause: The bash script in koel-entrypoint becomes PID 1, and doesn't forward signals (like SIGWINCH/SIGTERM) to the Apache child process. Docker waits for timeout, then sends SIGKILL.

Solution

Use exec to replace bash with Apache as PID 1, so signals reach Apache directly.

Also quotes "$@" for proper argument handling (best practice).

Result

Container now shuts down gracefully in 1-2 seconds instead of being killed after 10 seconds.

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