Add nginx health check

This commit is contained in:
Wietse Wind
2023-10-08 00:36:34 +02:00
parent 2e06c852f1
commit 31e80a5f0d
2 changed files with 13 additions and 1 deletions

View File

@@ -48,6 +48,11 @@ http {
autoindex_format html;
location /healthcheck {
return 200 'Hi there!';
add_header Content-Type text/plain;
}
location /xpop {
root /usr/share/nginx/html;
autoindex off;

View File

@@ -1,4 +1,4 @@
version: '3.3'
version: '3.4'
services:
nginx:
container_name: xpopweb
@@ -11,6 +11,13 @@ services:
ports:
- ${PORT:-3000}:3000
image: nginx:alpine
restart: unless-stopped
healthcheck:
test: curl --fail http://localhost:3000/healthcheck || exit 1
interval: 15s
retries: 2
start_period: 5s
timeout: 5s
xpop:
container_name: xpop
image: xpop:service