Skip to content

Commit 1525339

Browse files
Copilotdannystaple
andcommitted
Add healthcheck to http_serve service in docker-compose
Co-authored-by: dannystaple <426859+dannystaple@users.noreply.github.com>
1 parent 7ba9079 commit 1525339

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

docker-compose.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,12 @@ services:
8686
- ./htaccess:/usr/local/apache2/htdocs/.htaccess
8787
ports:
8888
- 8082:80
89+
healthcheck:
90+
test: ["CMD", "curl", "-o", "/dev/null", "-s", "http://localhost"]
91+
interval: 10s
92+
timeout: 5s
93+
retries: 5
94+
start_period: 30s
8995
profiles:
9096
- manual
9197

serve.Dockerfile

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,10 @@ FROM dcycle/broken-link-checker:3 AS broken_link_checker
2121

2222
FROM httpd:2.4.64 AS httpd_serve
2323

24+
# Install curl for healthcheck
25+
RUN apt-get update && apt-get install -y curl && rm -rf /var/lib/apt/lists/*
26+
2427
# COPY _site /var/www/html/
25-
COPY .github/scripts/staging/http2.conf /etc/httpd/conf/httpd.conf
28+
# COPY .github/scripts/staging/http2.conf /usr/local/apache2/conf/httpd.conf
2629

2730
FROM base

0 commit comments

Comments
 (0)