aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/docker/frontend/Dockerfile
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--docker/frontend/Dockerfile39
1 files changed, 29 insertions, 10 deletions
diff --git a/docker/frontend/Dockerfile b/docker/frontend/Dockerfile
index 5fb1960..337d4f6 100644
--- a/docker/frontend/Dockerfile
+++ b/docker/frontend/Dockerfile
@@ -1,19 +1,38 @@
-FROM nginx:1
-
-RUN export DEBIAN_FRONTEND=noninteractive && \
- runtime_deps='cgit cmark-gfm fcgiwrap tini' && \
- apt-get update && \
- apt-get install -y --no-install-recommends $runtime_deps && \
- # Install the latest Pygments (so that it would highlight CMakeLists.txt, etc.):
- apt-get install -y --no-install-recommends python3-pip && \
- pip3 install --no-cache-dir pygments~=2.0 && \
+FROM nginx:1-alpine AS base
+
+FROM base AS builder
+
+# Install cmark-gfm:
+ARG CMARK_GFM_VERSION=0.29.0.gfm.3
+ADD ["https://github.com/github/cmark-gfm/archive/refs/tags/$CMARK_GFM_VERSION.zip", "/"]
+
+RUN apk add --no-cache cmake g++ make python2 py3-pip && \
+ unzip -- "$CMARK_GFM_VERSION.zip" && \
+ cd -- "cmark-gfm-$CMARK_GFM_VERSION" && \
+ make INSTALL_PREFIX=/cmark-gfm && \
+ make test && \
+ make install
+
+# Install the latest Pygments (so that it would highlight CMakeLists.txt, etc.):
+ARG PYGMENTS_VERSION=~=2.0
+
+RUN apk add --no-cache py3-pip && \
+ pip install --no-cache-dir --target=/pygments "pygments$PYGMENTS_VERSION"
+
+FROM base
+
+RUN apk add --no-cache bash cgit fcgiwrap python3 spawn-fcgi tini && \
# Replace the theme with the one I like better:
grep -q -F -- "style='pastie'" /usr/lib/cgit/filters/syntax-highlighting.py && \
sed -i -e "s/style='pastie'/style='vs'/" -- /usr/lib/cgit/filters/syntax-highlighting.py
+COPY --from=builder ["/cmark-gfm", "/usr/local/"]
+COPY --from=builder ["/pygments", "/pygments/"]
+ENV PYTHONPATH="/pygments"
+
COPY ["etc/", "/etc/"]
COPY ["usr/", "/usr/"]
COPY ["cmd.sh", "/"]
-ENTRYPOINT ["/usr/bin/tini", "--"]
+ENTRYPOINT ["/sbin/tini", "--"]
CMD ["/cmd.sh"]