From 10e98e1bdc4e600de1aac5cf4ca1df6039809444 Mon Sep 17 00:00:00 2001 From: Henrik Jess Nielsen Date: Mon, 13 Jul 2026 20:57:04 +0200 Subject: [PATCH] Remove apt-get/curl dependency from Docker healthcheck Use Python urllib instead of curl for the container healthcheck to avoid needing apt-get install during image build (was hitting disk space issues on the build host). --- Dockerfile | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/Dockerfile b/Dockerfile index bac4dad..d895357 100644 --- a/Dockerfile +++ b/Dockerfile @@ -4,10 +4,6 @@ FROM python:3.11-slim AS base ENV PYTHONDONTWRITEBYTECODE=1 \ PYTHONUNBUFFERED=1 -RUN apt-get update && apt-get install -y --no-install-recommends \ - curl \ - && rm -rf /var/lib/apt/lists/* - RUN groupadd -r iobj && useradd -r -g iobj -m iobj WORKDIR /app RUN mkdir -p /app/data && chown -R iobj:iobj /app @@ -26,9 +22,10 @@ USER iobj ENV IOBJ_DATA_DIR=/app/data -# Health check — dynamic port support for Nomad +# Health check — dynamic port support for Nomad (no curl/apt-get needed) HEALTHCHECK --interval=30s --timeout=10s --start-period=5s --retries=3 \ - CMD curl -f http://localhost:${PORT:-8000}/health || exit 1 + CMD python -c "import os,urllib.request,sys; \ + urllib.request.urlopen(f'http://localhost:{os.environ.get(\"PORT\",\"8000\")}/health', timeout=5)" || exit 1 EXPOSE 8000