El plugin depende de GitPython, que necesita el binario git para importarse (no solo para leer fechas) — sin él, mkdocs build --strict falla en el import del plugin antes de llegar al fallback_to_build_date configurado en mkdocs.yml. Detectado en el primer intento real de build en Gitea Actions (run 94, job 106).
30 lines
888 B
Docker
30 lines
888 B
Docker
# --- Stage 1: build del sitio estático con MkDocs Material ---
|
|
FROM python:3.12-slim AS build
|
|
|
|
WORKDIR /site
|
|
|
|
# mkdocs-git-revision-date-localized-plugin depende de GitPython, que
|
|
# necesita el binario git presente solo para poder importarse (si falta,
|
|
# el import truena y rompe el build --strict, incluso con
|
|
# fallback_to_build_date activado en mkdocs.yml).
|
|
RUN apt-get update \
|
|
&& apt-get install -y --no-install-recommends git \
|
|
&& rm -rf /var/lib/apt/lists/*
|
|
|
|
COPY requirements.txt .
|
|
RUN pip install --no-cache-dir -r requirements.txt
|
|
|
|
COPY mkdocs.yml .
|
|
COPY docs/ docs/
|
|
|
|
# --strict: cualquier link roto o warning de nav rompe el build,
|
|
# para no publicar nunca un sitio con referencias muertas.
|
|
RUN mkdocs build --strict
|
|
|
|
# --- Stage 2: sirve el sitio estático generado con nginx ---
|
|
FROM nginx:1.27-alpine
|
|
|
|
COPY --from=build /site/site /usr/share/nginx/html
|
|
|
|
EXPOSE 80
|