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.
This commit is contained in:
tcely
2025-01-12 00:37:30 -05:00
committed by GitHub
parent b829b233f8
commit ef4181c2c4

View File

@@ -1,3 +1,6 @@
# syntax=docker/dockerfile:1
# check=error=true
FROM debian:bookworm-slim FROM debian:bookworm-slim
ARG TARGETARCH ARG TARGETARCH
@@ -228,7 +231,7 @@ RUN set -x && \
COPY config/root / COPY config/root /
# Create a healthcheck # 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 # ENVS and ports
ENV PYTHONPATH="/app" PYTHONPYCACHEPREFIX="/config/cache/pycache" ENV PYTHONPATH="/app" PYTHONPYCACHEPREFIX="/config/cache/pycache"