mirror of
https://github.com/tarampampam/error-pages.git
synced 2024-08-30 18:22:40 +00:00
Nginx Healthcheck endpoint + Dockerfile healthcheck (#23)
Co-authored-by: modem7 <modem7@gmail.com>
This commit is contained in:
parent
501d141ce7
commit
ce98410e51
@ -4,6 +4,15 @@ All notable changes to this package will be documented in this file.
|
|||||||
|
|
||||||
The format is based on [Keep a Changelog][keepachangelog] and this project adheres to [Semantic Versioning][semver].
|
The format is based on [Keep a Changelog][keepachangelog] and this project adheres to [Semantic Versioning][semver].
|
||||||
|
|
||||||
|
## v1.8.0
|
||||||
|
|
||||||
|
### Added
|
||||||
|
|
||||||
|
- Nginx health-check endpoint (`/health/live`) and dockerfile `HEALTHCHECK` to utilise (thx [@modem7](https://github.com/modem7)) [#22], [#23]
|
||||||
|
|
||||||
|
[#22]:https://github.com/tarampampam/error-pages/pull/22
|
||||||
|
[#23]:https://github.com/tarampampam/error-pages/pull/23
|
||||||
|
|
||||||
## v1.7.2
|
## v1.7.2
|
||||||
|
|
||||||
### Changed
|
### Changed
|
||||||
|
@ -30,7 +30,7 @@ RUN set -x \
|
|||||||
&& mv /src/docker/nginx-server.conf ./etc/nginx/conf.d/default.conf
|
&& mv /src/docker/nginx-server.conf ./etc/nginx/conf.d/default.conf
|
||||||
|
|
||||||
# Image page: <https://hub.docker.com/_/nginx>
|
# Image page: <https://hub.docker.com/_/nginx>
|
||||||
FROM nginx:1.21-alpine as runtime
|
FROM nginx:1.21.1-alpine as runtime
|
||||||
|
|
||||||
LABEL \
|
LABEL \
|
||||||
# Docs: <https://github.com/opencontainers/image-spec/blob/master/annotations.md>
|
# Docs: <https://github.com/opencontainers/image-spec/blob/master/annotations.md>
|
||||||
@ -44,4 +44,9 @@ LABEL \
|
|||||||
# Import from builder
|
# Import from builder
|
||||||
COPY --from=builder /tmp/rootfs /
|
COPY --from=builder /tmp/rootfs /
|
||||||
|
|
||||||
|
# Docs: <https://docs.docker.com/engine/reference/builder/#healthcheck>
|
||||||
|
HEALTHCHECK --interval=15s --timeout=2s --retries=2 --start-period=2s CMD [ \
|
||||||
|
"wget", "--spider", "-q", "http://127.0.0.1:8080/health/live" \
|
||||||
|
]
|
||||||
|
|
||||||
RUN chown -R nginx:nginx /opt/html
|
RUN chown -R nginx:nginx /opt/html
|
||||||
|
@ -19,6 +19,13 @@ server {
|
|||||||
root /opt/html;
|
root /opt/html;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# Health-check (liveness probe)
|
||||||
|
location = /health/live {
|
||||||
|
access_log off;
|
||||||
|
default_type text/plain;
|
||||||
|
return 200 "healthy\n";
|
||||||
|
}
|
||||||
|
|
||||||
location / {
|
location / {
|
||||||
try_files $uri =404;
|
try_files $uri =404;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user