pikvm-pikvm
SUCCESS
2m 25s
History Source
SummaryIterations1Transcript3Dockerfile
Dockerfile37 lines · 894 chars
# Stage 1: Builder - install dependencies and build docs
FROM python:3.11-slim as builder

# Install build dependencies
RUN apt-get update && \
    apt-get install -y --no-install-recommends git && \
    rm -rf /var/lib/apt/lists/*

# Set workdir and copy repo
WORKDIR /src
COPY . .

# Install Python dependencies including MkDocs and plugins
RUN python -m pip install --no-cache-dir --upgrade pip && \
    python -m pip install --no-cache-dir \
        mkdocs \
        mkdocs-material \
        mkdocs-video \
        mkdocs-redirects \
        mkdocs-glightbox \
        mkdocs-rss-plugin \
        git+https://github.com/pikvm/markdown-include

# Build MkDocs site
RUN mkdocs build

# Stage 2: Runtime
FROM python:3.11-slim

# Expose port for the static site server
EXPOSE 8000

WORKDIR /site
COPY --from=builder /src/site /site

CMD ["python","-m","http.server","8000","--bind","0.0.0.0"]