mirror of
https://github.com/alexbelgium/hassio-addons.git
synced 2026-10-06 00:01:37 +02:00
Compare commits
4 Commits
c838d19ab6
...
dbd33c5bad
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
dbd33c5bad | ||
|
|
c9070c848a | ||
|
|
6a4996a480 | ||
|
|
042c44f012 |
@@ -115,27 +115,4 @@ LABEL \
|
|||||||
# 6 Healthcheck #
|
# 6 Healthcheck #
|
||||||
#################
|
#################
|
||||||
|
|
||||||
# Avoid spamming logs
|
# Upstream
|
||||||
# hadolint ignore=SC2016
|
|
||||||
RUN \
|
|
||||||
# Handle Apache configuration
|
|
||||||
if [ -d /etc/apache2/sites-available ]; then \
|
|
||||||
for file in /etc/apache2/sites-*/*.conf; do \
|
|
||||||
sed -i '/<VirtualHost/a \ \n # Match requests with the custom User-Agent "HealthCheck" \n SetEnvIf User-Agent "HealthCheck" dontlog \n # Exclude matching requests from access logs \n CustomLog ${APACHE_LOG_DIR}/access.log combined env=!dontlog' "$file"; \
|
|
||||||
done; \
|
|
||||||
fi && \
|
|
||||||
\
|
|
||||||
# Handle Nginx configuration
|
|
||||||
if [ -f /etc/nginx/nginx.conf ]; then \
|
|
||||||
awk '/http \{/{print; print "map $http_user_agent $dontlog {\n default 0;\n \"~*HealthCheck\" 1;\n}\naccess_log /var/log/nginx/access.log combined if=$dontlog;"; next}1' /etc/nginx/nginx.conf > /etc/nginx/nginx.conf.new && \
|
|
||||||
mv /etc/nginx/nginx.conf.new /etc/nginx/nginx.conf; \
|
|
||||||
fi
|
|
||||||
|
|
||||||
ENV HEALTH_PORT="8080" \
|
|
||||||
HEALTH_URL=""
|
|
||||||
HEALTHCHECK \
|
|
||||||
--interval=5s \
|
|
||||||
--retries=5 \
|
|
||||||
--start-period=30s \
|
|
||||||
--timeout=25s \
|
|
||||||
CMD curl -A "HealthCheck: Docker/1.0" -s -f "http://127.0.0.1:${HEALTH_PORT}${HEALTH_URL}" &>/dev/null || curl -k --fail "https://127.0.0.1:${HEALTH_PORT}${HEALTH_URL}" &>/dev/null || exit 1
|
|
||||||
|
|||||||
8
filebrowser_quantum/rootfs/etc/nginx/servers/health.conf
Normal file
8
filebrowser_quantum/rootfs/etc/nginx/servers/health.conf
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
server {
|
||||||
|
listen 127.0.0.1:3001;
|
||||||
|
access_log off;
|
||||||
|
|
||||||
|
location /health {
|
||||||
|
return 200 'OK';
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user