File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11# syntax=docker/dockerfile:1.16.0@sha256:e2dd261f92e4b763d789984f6eab84be66ab4f5f08052316d8eb8f173593acf7
22# check=error=true
33
4+ # BusyBox command help: https://www.busybox.net/downloads/BusyBox.html
45FROM docker.io/python:3.13.14-alpine@sha256:b4d299311845147e7e47c970566906caf8378a1f04e5d3de65b5f2e834f8e3bf
56
6- WORKDIR /run
7+ # Setup prerequisites for MkDocs Git-related features (e.g. revisions, collaborators, ...)
8+ RUN apk add --no-cache git
9+
10+ # Trust mounted host files in container at runtime
11+ RUN git config --system --add safe.directory /run
12+
13+ # New user and group for MkDocs
14+ RUN addgroup -S -g 1000 mkdocs && \
15+ adduser -S -u 1000 -G mkdocs mkdocs
16+
17+ USER 1000:1000
18+
19+ ENV HOME=/home/mkdocs
20+ ENV PATH="${PATH}:${HOME}/.local/bin"
21+
22+ WORKDIR ${HOME}
723
824COPY requirements/requirements.txt .
925
10- RUN \
11- # # Install MkDocs and its dependencies
12- pip install --no-cache-dir --require-hashes --requirement requirements.txt \
13- && \
14- rm requirements.txt \
15- # # Setup prerequisites for MkDocs Git-related features (e.g. revisions, collaborators, ...)
16- && \
17- apk add --no-cache git \
18- && \
19- git config --system --add safe.directory /run
20-
21- USER daemon
26+ # Install MkDocs and its dependencies
27+ RUN pip install --user --require-hashes --requirement requirements.txt && rm requirements.txt
28+
29+ WORKDIR /run
2230
2331EXPOSE 8000
2432
Original file line number Diff line number Diff line change @@ -20,6 +20,7 @@ case "$(uname)" in
2020 ;;
2121esac
2222
23+ # Constraint: MkDocs' Git plugin requires access to the Git history.
2324ROOT_PROJECT_DIR=" ${SCRIPT_DIR} /../.."
2425
2526echo ' Building Docker image for MkDocs (can take up to a minute)'
@@ -30,7 +31,7 @@ GITHUB_TOKEN="${GITHUB_TOKEN:-$(gh auth token)}"
3031
3132echo
3233echo ' Running MkDocs:'
33- # Avoid permission issues by running the container with the current user ID and group ID
34+ # Avoid permission issues by running the container with the current user ID and group ID.
3435docker run --rm -p 8000:8000 --name docker-papermc-server-mkdocs \
3536 --user " $( id -u) :$( id -g) " \
3637 --mount type=bind,source=" ${ROOT_PROJECT_DIR} " ,target=/run \
You can’t perform that action at this time.
0 commit comments