diff --git a/Dockerfile b/Dockerfile index 9fc68b7..988708b 100644 --- a/Dockerfile +++ b/Dockerfile @@ -2,7 +2,7 @@ FROM httpd:2.4 # We will need openssl tool for the entrypoint -RUN apt-get -qq update && apt-get -q install -y openssl && rm -rf /var/lib/apt/lists/* +RUN apt-get -qq update && apt-get -q install -y openssl netcat && rm -rf /var/lib/apt/lists/* # Prepare our apache configuration RUN rm /usr/local/apache2/conf/extra/httpd-vhosts.conf /usr/local/apache2/conf/original/extra/httpd-ssl.conf @@ -16,6 +16,9 @@ RUN chmod 644 /usr/local/apache2/conf/httpd.conf /usr/local/apache2/conf/extra/h COPY files/entrypoint.sh / RUN chmod 755 /entrypoint.sh +# Configure healthcheck - use "nc" to see if port 80 is open, because curl might still get errors (403, etc) +HEALTHCHECK --interval=5s --timeout=3s CMD nc -z -v localhost 80 || exit 1 + # Also expose SSL port EXPOSE 80 443