From fb5603e454f6ce59d4d384d4db8433da1273a376 Mon Sep 17 00:00:00 2001 From: govardhan Date: Thu, 19 Jun 2025 21:24:39 +0530 Subject: [PATCH] kjkjk --- Dockerfile | 32 ++++++++++++-------------------- 1 file changed, 12 insertions(+), 20 deletions(-) diff --git a/Dockerfile b/Dockerfile index e6a8810..2075a33 100644 --- a/Dockerfile +++ b/Dockerfile @@ -2,22 +2,19 @@ FROM python:3.9-slim AS builder # Set environment variables to avoid interactive prompts -ENV PYTHONDONTWRITEBYTECODE=1 \ - PYTHONUNBUFFERED=1 \ - DEBIAN_FRONTEND=noninteractive +ENV DEBIAN_FRONTEND=noninteractive -# Update package lists and install build dependencies -RUN apt-get update && apt-get install -y --no-install-recommends \ +# Configure apt to use reliable mirrors +RUN echo "deb http://ftp.debian.org/debian bookworm main" > /etc/apt/sources.list && \ + echo "deb http://ftp.debian.org/debian-security bookworm-security main" >> /etc/apt/sources.list && \ + echo "deb http://ftp.us.debian.org/debian bookworm main" >> /etc/apt/sources.list + +# Install build dependencies and clean up in one step +RUN apt-get update -o Acquire::Retries=10 -o Acquire::http::Timeout=30 && \ + apt-get install -y --no-install-recommends \ gcc \ - g++ \ - libc6-dev \ - libffi-dev \ - libssl-dev \ - make \ - && rm -rf /var/lib/apt/lists/* - -# Upgrade pip to latest version -RUN pip install --upgrade pip + python3-dev && \ + rm -rf /var/lib/apt/lists/* # Install MkDocs and plugins with exact versions RUN pip install --no-cache-dir \ @@ -41,11 +38,6 @@ RUN mkdocs build --strict # Runtime stage FROM python:3.9-slim -# Install wget for healthcheck -RUN apt-get update && apt-get install -y --no-install-recommends \ - wget \ - && rm -rf /var/lib/apt/lists/* - # Set working directory WORKDIR /site @@ -57,7 +49,7 @@ EXPOSE 80 # Healthcheck to ensure the server is running HEALTHCHECK --interval=30s --timeout=3s \ - CMD wget -qO- http://localhost:80/ || exit 1 + CMD curl -f http://localhost:80/ || exit 1 # Serve the static site with Python's http.server CMD ["python", "-m", "http.server", "80"] \ No newline at end of file