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