~ajhalili2006's personal website, built with Zensical (successor of Material for Mkdocs) [old repo name got bugged while attempting to do manual knot migration via repo deletion]
andreijiroh.dev
zensical
mkdocs-material
website
1# syntax=docker/dockerfile:1
2# Since we're building against edge at risk, it is important to note
3# that anything might go wrong.
4FROM alpine:edge AS buildkit
5
6# Since hadolint isn't in the package repos for Alpine yet, we'll copying from the offical
7# Docker image instead.
8COPY --from=ghcr.io/hadolint/hadolint:latest-alpine /bin/hadolint /usr/bin/hadolint
9
10ENV PACKAGES=/usr/local/lib/python3.11/site-packages
11ENV PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/root/.local/bin
12ENV PYTHONDONTWRITEBYTECODE=1
13
14# https://squidfunk.github.io/mkdocs-material/setup/setting-up-social-cards/#linux but for Alpine
15# Also installs Doppler CLI for accessing secrets securely within CI
16# hadolint ignore=DL3018,DL3013
17RUN apk add --no-cache \
18 cairo-dev \
19 freetype-dev \
20 libffi-dev \
21 jpeg-dev \
22 libpng-dev \
23 zlib-dev \
24 bash \
25 coreutils \
26 python3 \
27 py3-pip \
28 pipx \
29 py3-wheel \
30 shellcheck \
31 gcc \
32 libffi-dev \
33 musl-dev \
34 nodejs \
35 npm \
36 yarn \
37 git \
38 git-email \
39 git-lfs \
40 git-fast-import \
41 openssh \
42 gnupg \
43 curl \
44 && curl -Ls --tlsv1.2 --proto "=https" --retry 3 https://cli.doppler.com/install.sh \
45 | sh
46
47# See https://www.jeffgeerling.com/blog/2023/how-solve-error-externally-managed-environment-when-installing-pip3
48# for context behind removing the EXTERNALLY-MANAGED file
49RUN rm -rv /usr/lib/python3*/EXTERNALLY-MANAGED \
50 && pip install --no-cache \
51 mkdocs-material \
52 mkdocs-git-committers-plugin-2 \
53 mkdocs-git-revision-date-localized-plugin \
54 mkdocs-minify-plugin \
55 mkdocs-redirects \
56 mkdocs-rss-plugin \
57 pillow \
58 cairosvg \
59 pipenv
60
61# Trust directory, required for git >= 2.35.2
62# Follows the docs for the Docker-based site build setup
63RUN git config --global --add safe.directory /docs &&\
64 git config --global --add safe.directory /site
65
66# Expose MkDocs development server port
67EXPOSE 8000
68
69WORKDIR /docs
70
71#COPY entrypoint.sh /usr/local/bin/entrypoint
72CMD [ "mkdocs", "serve", "--dev-addr=0.0.0.0:8000" ]