Skip to content

Commit

Permalink
mkdocs docker image + start script
Browse files Browse the repository at this point in the history
  • Loading branch information
twagoo committed Oct 28, 2024
1 parent 5475b05 commit 819c218
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 11 deletions.
23 changes: 13 additions & 10 deletions docker/mkdocs/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,14 +1,17 @@
FROM registry.gitlab.com/clarin-eric/docker-alpine-base:2.3.3

# Alpine package dependencies
RUN apk add --no-cache \
'py3-pip=22.3.1-r1'
FROM registry.gitlab.com/clarin-eric/docker-alpine-base:2.6.9

# Install mkdocs
RUN pip install wheel && \
pip install \
mkdocs \
mkdocs-material
RUN apk add --no-cache 'py3-pip=23.3.1-r0' \
&& python3 -m venv /mkdocs \
&& . /mkdocs/bin/activate \
&& pip install wheel \
&& pip install mkdocs mkdocs-material

RUN echo -e \
"#!/usr/bin/env bash\n" \
"source /mkdocs/bin/activate && mkdocs \"\$@\"" \
> /usr/local/bin/entrypoint.sh \
&& chmod +x /usr/local/bin/entrypoint.sh

ENTRYPOINT [ "/usr/bin/mkdocs" ]
ENTRYPOINT [ "/usr/local/bin/entrypoint.sh" ]
CMD []
2 changes: 1 addition & 1 deletion serve.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ echo "Building mkdocs image"
docker build --tag 'mkdocs:latest' 'docker/mkdocs'

echo "Starting server on http://localhost:${MKDOCS_SERVER_PORT}/"
docker run --rm --name mkdocs_serve\
docker run --rm -ti --name mkdocs_serve\
-v "${SCRIPT_DIR}:/work" \
-w '/work' \
-p "${MKDOCS_SERVER_PORT}:${MKDOCS_SERVER_PORT}" \
Expand Down

0 comments on commit 819c218

Please sign in to comment.