diff --git a/Containerfile.slim b/Containerfile.slim index d8c2117..be173b5 100644 --- a/Containerfile.slim +++ b/Containerfile.slim @@ -20,7 +20,8 @@ RUN pip install --no-cache-dir --upgrade "pip>=25.3" wheel # Install Python dependencies (includes security pins from requirements.txt) COPY requirements.txt . -RUN pip install --no-cache-dir -r requirements.txt gunicorn +RUN pip install --no-cache-dir -r requirements.txt gunicorn && \ + pip install --no-cache-dir --force-reinstall "jaraco.context>=6.1.0" # Stage 2: Alpine runtime (minimal) @@ -32,7 +33,9 @@ LABEL description="Minimal secure pastebin REST API (Alpine)" # Apply security fixes to base image (versions from requirements.txt) COPY requirements.txt /tmp/ RUN pip install --no-cache-dir --upgrade pip && \ - pip install --no-cache-dir -r /tmp/requirements.txt && rm /tmp/requirements.txt + pip install --no-cache-dir -r /tmp/requirements.txt && \ + pip install --no-cache-dir --force-reinstall "jaraco.context>=6.1.0" && \ + rm /tmp/requirements.txt # Create non-root user RUN addgroup -g 65532 -S flaskpaste && adduser -u 65532 -S -G flaskpaste flaskpaste