From 7535d8bb037cacc483d5859d5bc26ef3358c7bb7 Mon Sep 17 00:00:00 2001 From: Seaswimmer Date: Mon, 5 Aug 2024 15:41:01 -0400 Subject: [PATCH] add container healthcheck --- Dockerfile | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Dockerfile b/Dockerfile index c6e62d6..62bcc8b 100644 --- a/Dockerfile +++ b/Dockerfile @@ -7,9 +7,13 @@ COPY README.md README.md COPY requirements.txt requirements.txt COPY LICENSE LICENSE +RUN apk add --no-cache curl + RUN python -m pip install --upgrade pip RUN python -m pip install --no-cache-dir -r requirements.txt CMD ["python", "src/main.py"] +HEALTHCHECK --interval=1m --timeout=30s --start-period=10s --retries=3 CMD curl -f http://localhost:80 || exit 1 + EXPOSE 80