Dockerfile 1.8 KB

123456789101112131415161718192021222324252627282930313233343536
  1. FROM docker.io/alpine:3.20.1 AS borgmatic
  2. COPY . /app
  3. RUN apk add --no-cache py3-pip py3-ruamel.yaml py3-ruamel.yaml.clib
  4. RUN pip install --break-system-packages --no-cache /app && borgmatic config generate && chmod +r /etc/borgmatic/config.yaml
  5. RUN borgmatic --help > /command-line.txt \
  6. && for action in repo-create transfer create prune compact check delete extract config "config bootstrap" "config generate" "config validate" export-tar mount umount repo-delete restore repo-list list repo-info info break-lock "key export" "key import" "key change-passphrase" recreate borg; do \
  7. echo -e "\n--------------------------------------------------------------------------------\n" >> /command-line.txt \
  8. && borgmatic $action --help >> /command-line.txt; done
  9. RUN /app/docs/fetch-contributors >> /contributors.html
  10. FROM docker.io/node:22.4.0-alpine AS html
  11. ARG ENVIRONMENT=production
  12. WORKDIR /source
  13. RUN npm install @11ty/eleventy \
  14. @11ty/eleventy-plugin-syntaxhighlight \
  15. @11ty/eleventy-plugin-inclusive-language \
  16. @11ty/eleventy-navigation \
  17. eleventy-plugin-code-clipboard \
  18. markdown-it \
  19. markdown-it-anchor \
  20. markdown-it-replace-link
  21. COPY --from=borgmatic /etc/borgmatic/config.yaml /source/docs/_includes/borgmatic/config.yaml
  22. COPY --from=borgmatic /command-line.txt /source/docs/_includes/borgmatic/command-line.txt
  23. COPY --from=borgmatic /contributors.html /source/docs/_includes/borgmatic/contributors.html
  24. COPY . /source
  25. RUN NODE_ENV=${ENVIRONMENT} npx eleventy --input=/source/docs --output=/output/docs \
  26. && mv /output/docs/index.html /output/index.html
  27. FROM docker.io/nginx:1.26.1-alpine
  28. COPY --from=html /output /usr/share/nginx/html
  29. COPY --from=borgmatic /etc/borgmatic/config.yaml /usr/share/nginx/html/docs/reference/config.yaml