I have a very very simple Go app listening on port 8080
http.HandleFunc(\"/\", func(w http.ResponseWriter, r *http.Request) {
w.WriteHeader(200)
w.He
A very comprehensive description of this problem and the solutions can be found here: https://vsupalov.com/docker-compose-stop-slow
In my case, my app expects to receive SIGTERM signal for graceful shutdown didn't receive it because the process started by a bash script which called from a dockerfile in this form: ENTRYPOINT ["/path/to/script.sh"]
so the script didn't propagate the SIGTERM to the app. The solution was to use exec from the script run the command that starts the app: e.g. exec java -jar ...