Files
manuals/Dockerfile
T
julienfastre 210823c23a
Build and Push MkDocs Docker Image / build-and-push (push) Successful in 1m43s
Update Dockerfile to include Sveltia CMS admin files in user documentation build
2026-08-26 21:53:25 +02:00

30 lines
828 B
Docker

# -------- Stage 1: Build the documentation using mkdocs --------
FROM python:3.13-slim AS builder
# add pandoc to image
COPY --from=pandoc/minimal:3 /usr/local/bin/pandoc /usr/local/bin/pandoc
RUN chmod +x /usr/local/bin/pandoc
WORKDIR /build
# Install dependencies
COPY requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt
COPY mkdocs/ mkdocs/
COPY pandoc/filters pandoc/filters
COPY user/ user/
COPY admin/ admin/
RUN cd user && mkdocs build --clean && cp -r sveltia/_admin site/. && cd ..
RUN cd admin && mkdocs build --clean && cd ..
# -------- Stage 2: Serve the built documentation with nginx --------
FROM nginx:alpine
# Copy the built site from the builder stage
COPY --from=builder /build/admin/site /usr/share/nginx/html/admin
COPY --from=builder /build/user/site /usr/share/nginx/html/user