Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add healthcheck to web container #5

Merged
merged 1 commit into from
May 9, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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

Expand Down