From ef4181c2c42239512c811bdb6fb456bdcb0289cd Mon Sep 17 00:00:00 2001 From: tcely Date: Sun, 12 Jan 2025 00:37:30 -0500 Subject: [PATCH] Dockerfile syntax and checks - Specify the syntax be the latest stable version and that failed checks should stop the build. ``` By default, builds with failing build checks exit with a zero status code despite warnings. To make the build fail on warnings, set #check=error=true. ``` - Use the form of health checking that doesn't involve an extra shell on every check. --- Dockerfile | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 880dd677..c63e24d2 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,3 +1,6 @@ +# syntax=docker/dockerfile:1 +# check=error=true + FROM debian:bookworm-slim ARG TARGETARCH @@ -228,7 +231,7 @@ RUN set -x && \ COPY config/root / # Create a healthcheck -HEALTHCHECK --interval=1m --timeout=10s CMD /app/healthcheck.py http://127.0.0.1:8080/healthcheck +HEALTHCHECK --interval=1m --timeout=10s --start-period=3m CMD ["/app/healthcheck.py", "http://127.0.0.1:8080/healthcheck"] # ENVS and ports ENV PYTHONPATH="/app" PYTHONPYCACHEPREFIX="/config/cache/pycache"