Skip to content

Commit c3af913

Browse files
committed
Add healthcheck.
1 parent 9400956 commit c3af913

2 files changed

Lines changed: 9 additions & 0 deletions

File tree

Dockerfile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,8 @@ RUN sed -i "s/nginx:x:100:101:nginx:\/var\/lib\/nginx:\/sbin\/nologin/nginx:x:10
116116

117117
EXPOSE 80
118118

119+
HEALTHCHECK --interval=30s --timeout=5s --start-period=20s --retries=3 CMD curl -fsS http://127.0.0.1/health || exit 1
120+
119121
VOLUME ["/DATA"]
120122

121123
CMD ["/usr/bin/s6-svscan", "/etc/s6"]

rootfs/etc/nginx/host.conf

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,13 @@ index index.html index.htm;
55

66
disable_symlinks off;
77

8+
# Simple health endpoint always returns 200 OK
9+
location = /health {
10+
access_log off;
11+
default_type text/plain;
12+
return 200 'OK';
13+
}
14+
815
location / {
916
try_files $uri $uri/;
1017
}

0 commit comments

Comments
 (0)