skip to Main Content

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


  1. Chosen as BEST ANSWER

    Fixed!

    The Dockerfile included a healthcheck command, namely:

    HEALTHCHECK --interval=5s --timeout=3s CMD curl --fail http://localhost:80/ || exit 1
    

    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.


  2. Ask your hosting provider. Probably they send SIGTERM to your container. See related answer, thx to @kdgregory

    SIGTERM is used to restart Apache (provided that it’s setup in init to auto-restart): http://httpd.apache.org/docs/2.2/stopping.html

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search