I’m using an httpd:alpine container to deploy a website developed on Angular, without using Node (due to several restrictions in the production environment). I’m actually using this amazing guide by Andreas Lorenzen as a base, specially the Dockerfile specified at the end of the article.
The problem is that, after some time of execution, the container suddenly stops without being able to restart itself. And the only information I receive from ‘docker logs’ is the following:
127.0.0.1 - - [29/Jul/2019:14:51:20 +0000] "GET / HTTP/1.1" 200 883
127.0.0.1 - - [29/Jul/2019:14:51:25 +0000] "GET / HTTP/1.1" 200 883
127.0.0.1 - - [29/Jul/2019:14:51:31 +0000] "GET / HTTP/1.1" 200 883
127.0.0.1 - - [29/Jul/2019:14:51:37 +0000] "GET / HTTP/1.1" 200 883
[Mon Jul 29 14:51:44.042754 2019] [mpm_event:notice] [pid 1:tid 139803211808072] AH00491: caught SIGTERM, shutting down
Any ideas on why is this happening? I tried to look for the Apache logs within the container, but I couldn’t find any… Thank you!
2
Answers
Fixed!
The Dockerfile included a healthcheck command, namely:
So, after the check failed for any reason, the container just got killed. Either remove that line from the Dockerfile or, better yet, instruct Docker to automatically restart the container whenever it dies.
Ask your hosting provider. Probably they send
SIGTERM
to your container. See related answer, thx to @kdgregory