-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
39 lines (30 loc) · 1.21 KB
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
# Redact the documents
FROM --platform=linux/arm64 registry.cluster.megaver.se/hub.docker.com/python:3.11-bookworm as redact
WORKDIR /workdir
# For better caching
COPY build/publish-secret-docs/requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt
# Include two repositories we need
COPY README.md /original/
COPY build/hetzner-k3s-main/ /original/cluster/
COPY build/publish-secret-docs/ ./
# Redact out the secrets: /original to /redacted
RUN python -m unittest tests/*.py
RUN python redact.py /original /redacted
# Prepare zola input tree: /redacted to /output
COPY zola/ /output/
RUN python to_markdown.py /redacted /output/content
# Zola requires file name to be _index.md to use co-located assets
RUN find /output/content -type f -name 'README.md' -execdir mv {} _index.md \;
# Run Zola
FROM --platform=linux/arm64 registry.cluster.megaver.se/library/zola as zola
WORKDIR /project
COPY --from=redact /output/ ./
RUN ["zola", "build"]
# Run web server
FROM registry.cluster.megaver.se/hub.docker.com/nginx
COPY --from=zola /project/public/ /usr/share/nginx/html/
RUN mv /etc/nginx/mime.types /etc/nginx/mime.types.original
COPY mime.types /etc/nginx/mime.types
EXPOSE 80
CMD ["nginx", "-g", "daemon off;"]