~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 rsync
45 && curl -Ls --tlsv1.2 --proto "=https" --retry 3 https://cli.doppler.com/install.sh \
46 | sh
47
48# See https://www.jeffgeerling.com/blog/2023/how-solve-error-externally-managed-environment-when-installing-pip3
49# for context behind removing the EXTERNALLY-MANAGED file
50RUN rm -rv /usr/lib/python3*/EXTERNALLY-MANAGED \
51 && pip install --no-cache \
52 mkdocs-material \
53 mkdocs-git-committers-plugin-2 \
54 mkdocs-git-revision-date-localized-plugin \
55 mkdocs-minify-plugin \
56 mkdocs-redirects \
57 mkdocs-rss-plugin \
58 pillow \
59 cairosvg \
60 pipenv
61
62# Trust directory, required for git >= 2.35.2
63# Follows the docs for the Docker-based site build setup
64RUN git config --global --add safe.directory /docs &&\
65 git config --global --add safe.directory /site
66
67# Expose MkDocs development server port
68EXPOSE 8000
69
70WORKDIR /docs
71
72#COPY entrypoint.sh /usr/local/bin/entrypoint
73CMD [ "mkdocs", "serve", "--dev-addr=0.0.0.0:8000" ]