Add HEALTHCHECK instruction to Dockerfile

This commit is contained in:
Andras Bacsai
2025-10-22 12:45:00 +02:00
committed by GitHub
parent 9f1ca26df1
commit 0ab2265da0

View File

@@ -6,9 +6,9 @@ RUN env
RUN echo "Hello, World!" > /usr/share/nginx/html/index.html RUN echo "Hello, World!" > /usr/share/nginx/html/index.html
RUN echo "Hello, World about!" > /usr/share/nginx/html/about.html RUN echo "Hello, World about!" > /usr/share/nginx/html/about.html
RUN env > /usr/share/nginx/html/env.html RUN env > /usr/share/nginx/html/env.html
HEALTHCHECK --interval=5s --timeout=3s --start-period=30s --retries=3 CMD wget -qO- http://localhost:80 || exit 1
FROM base AS builder FROM base AS builder
RUN echo -e "\e[1;33mENVIRONMENT VARIABLES\e[0m" RUN echo -e "\e[1;33mENVIRONMENT VARIABLES\e[0m"
RUN env RUN env
HEALTHCHECK --interval=5s --timeout=3s --start-period=30s --retries=3 CMD wget -qO- http://localhost:80 || exit 1