This commit is contained in:
govardhan
2025-06-19 21:19:59 +05:30
parent d5f8723766
commit aae9023182

View File

@ -1,23 +1,23 @@
# Build stage
FROM python:3.9-alpine3.16 AS builder
FROM python:3.9-slim AS builder
# Set environment variables to avoid interactive prompts
ENV PYTHONDONTWRITEBYTECODE=1 \
PYTHONUNBUFFERED=1
PYTHONUNBUFFERED=1 \
DEBIAN_FRONTEND=noninteractive
# Configure apk to use Alpine 3.16 repositories
RUN echo "https://dl-cdn.alpinelinux.org/alpine/v3.16/main" > /etc/apk/repositories && \
echo "https://dl-cdn.alpinelinux.org/alpine/v3.16/community" >> /etc/apk/repositories
# Update package index and install build dependencies
RUN apk update && apk add --no-cache \
# Update package lists and install build dependencies
RUN apt-get update && apt-get install -y --no-install-recommends \
gcc \
musl-dev \
python3-dev \
g++ \
libc6-dev \
libffi-dev \
openssl-dev \
libssl-dev \
make \
g++
&& rm -rf /var/lib/apt/lists/*
# Upgrade pip to latest version
RUN pip install --upgrade pip
# Install MkDocs and plugins with exact versions
RUN pip install --no-cache-dir \
@ -39,7 +39,12 @@ COPY docs/ ./docs/
RUN mkdocs build --strict
# Runtime stage
FROM python:3.9-alpine3.16
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