Dockerfile 1.4 KB

12345678910111213141516171819202122232425262728293031323334
  1. FROM alpine:3.17.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 --no-cache /app && generate-borgmatic-config && chmod +r /etc/borgmatic/config.yaml
  5. RUN borgmatic --help > /command-line.txt \
  6. && for action in rcreate transfer create prune compact check extract export-tar mount umount restore rlist list rinfo info break-lock borg; do \
  7. echo -e "\n--------------------------------------------------------------------------------\n" >> /command-line.txt \
  8. && borgmatic "$action" --help >> /command-line.txt; done
  9. FROM node:19.5.0-alpine as html
  10. ARG ENVIRONMENT=production
  11. WORKDIR /source
  12. RUN npm install @11ty/eleventy \
  13. @11ty/eleventy-plugin-syntaxhighlight \
  14. @11ty/eleventy-plugin-inclusive-language \
  15. @11ty/eleventy-navigation \
  16. eleventy-plugin-code-clipboard \
  17. markdown-it \
  18. markdown-it-anchor \
  19. markdown-it-replace-link
  20. COPY --from=borgmatic /etc/borgmatic/config.yaml /source/docs/_includes/borgmatic/config.yaml
  21. COPY --from=borgmatic /command-line.txt /source/docs/_includes/borgmatic/command-line.txt
  22. COPY . /source
  23. RUN NODE_ENV=${ENVIRONMENT} npx eleventy --input=/source/docs --output=/output/docs \
  24. && mv /output/docs/index.html /output/index.html
  25. FROM nginx:1.22.1-alpine
  26. COPY --from=html /output /usr/share/nginx/html
  27. COPY --from=borgmatic /etc/borgmatic/config.yaml /usr/share/nginx/html/docs/reference/config.yaml