FROM python:3.14.5-alpine3.23
# Install system dependencies required for MkDocs builds
RUN apk add --no-cache git openssl
# Set working directory for the build
WORKDIR /app
# Copy repository contents into the image
COPY . .
# Install Python build dependencies (MkDocs and plugins) and MkDocs include
RUN pip install --no-cache-dir \
mkdocs-material mkdocs-video mkdocs-redirects mkdocs-glightbox mkdocs-rss-plugin \
git+https://github.com/pikvm/markdown-include
# Build the MkDocs site from source
RUN mkdocs build
# Expose port for serving the built documentation
EXPOSE 8000
# Serve the generated site with Python's simple HTTP server
CMD ["sh", "-lc", "python -m http.server 8000 --directory site"]
# Ignore git, docs build artifacts, and local dev files .git .gitignore node_modules site *.pyc __pycache__ .env *.log *.md .DS_Store
# Ignore git, docs build artifacts, and local dev files .git .gitignore node_modules site *.pyc __pycache__ .env *.log *.md .DS_Store
Concerns: FROM image tag python:3.14.5-alpine3.23 likely does not exist in the official registry (3.14.x would be a future/release candidate). Consider pinning to a real, supported base image like python:3.11-alpine3.18 or python:3.12-alpine3.19 to ensure build reproducibility., MkDocs build relies on repository contents (mkdocs.yml and docs). If the repo lacks a proper MkDocs setup, the RUN mkdocs build step will fail; consider validating the MkDocs configuration as part of the CI or adding error handling for missing files. Smoke [FAIL]: python -m http.server 8000 --directory site & SERVER_PID=$!; sleep 1; curl -fsS http://localhost:8000/ | grep -q '<html'; kill $SERVER_PID Output: sh: curl: not found Smoke [FAIL]: python -m http.server 8000 --directory site & SERVER_PID=$!; sleep 1; curl -fsS http://localhost:8000/index.html | grep -qi '<!doctype html'; kill $SERVER_PID Output: sh: curl: not found
FROM python:3.11-alpine3.18
# Install system dependencies required for MkDocs builds
RUN apk add --no-cache git openssl curl
# Set working directory for the build
WORKDIR /app
# Copy repository contents into the image
COPY . .
# Install Python build dependencies (MkDocs and plugins) and MkDocs include
RUN pip install --no-cache-dir \
mkdocs-material mkdocs-video mkdocs-redirects mkdocs-glightbox mkdocs-rss-plugin \
git+https://github.com/pikvm/markdown-include
# Build the MkDocs site from source
RUN mkdocs build
# Expose port for serving the built documentation
EXPOSE 8000
# Serve the generated site with Python's simple HTTP server
CMD ["sh", "-lc", "python -m http.server 8000 --directory site"]
Smoke [FAIL]: python -m http.server 8000 --directory site >/tmp/server.log 2>&1 & sleep 1; curl -fsS http://localhost:8000/ | grep -q '<!DOCTYPE html> Output: sh: syntax error: unterminated quoted string Smoke [PASS]: test -s site/index.html
FROM python:3.12-alpine3.19
# Install system dependencies required for MkDocs builds
RUN apk add --no-cache git openssl curl
# Set working directory for the build
WORKDIR /app
# Copy repository contents into the image
COPY . .
# Install Python build dependencies (MkDocs and plugins) and MkDocs include
RUN pip install --no-cache-dir \
mkdocs-material mkdocs-video mkdocs-redirects mkdocs-glightbox mkdocs-rss-plugin \
git+https://github.com/pikvm/markdown-include
# Build the MkDocs site from source
RUN mkdocs build
# Expose port for serving the built documentation
EXPOSE 8000
# Serve the generated site with Python's simple HTTP server
CMD ["sh", "-lc", "python -m http.server 8000 --directory site"]
Concerns: The build relies on network access to install MkDocs and the GitHub markdown-include dependency; in offline or restricted environments the build may fail., Serving with Python's http.server is suitable for smoke tests but not production-grade; consider adding a basic health check or using a more robust server if needed. Smoke [PASS]: python -m http.server 8000 --directory site & pid=$!; sleep 1; curl -fsS http://localhost:8000/ | grep -q '<html'; kill $pid