My public website https://www.chameth.com/
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. ##
  2. ## Step 1 - add content and build with Hugo
  3. ##
  4. FROM debian:stretch as hugo
  5. RUN apt-get -qq update \
  6. && DEBIAN_FRONTEND=noninteractive apt-get -qq install -y --no-install-recommends python-pygments git ca-certificates asciidoc \
  7. && rm -rf /var/lib/apt/lists/*
  8. ENV HUGO_VERSION 0.22.1
  9. ENV HUGO_BINARY hugo_${HUGO_VERSION}_Linux-64bit.deb
  10. ADD https://github.com/spf13/hugo/releases/download/v${HUGO_VERSION}/${HUGO_BINARY} /tmp/hugo.deb
  11. RUN dpkg -i /tmp/hugo.deb \
  12. && rm /tmp/hugo.deb
  13. ARG baseurl=https://www.chameth.com/
  14. USER nobody:nogroup
  15. ADD site /tmp/site
  16. RUN hugo -b $baseurl -v -s /tmp/site -d /tmp/hugo && \
  17. cp /tmp/hugo/index.xml /tmp/hugo/feed.xml
  18. ##
  19. ## Step 2 - compress, minify, etc
  20. ##
  21. FROM debian:stretch as minify
  22. RUN apt-get update \
  23. && DEBIAN_FRONTEND=noninteractive apt-get -qq install -y --no-install-recommends yui-compressor tidy \
  24. && rm -rf /var/lib/apt/lists/*
  25. COPY --from=hugo /tmp/hugo /tmp/site
  26. ADD minify.sh /tmp/minify.sh
  27. RUN chown -R nobody:nogroup /tmp/site && chmod +x /tmp/minify.sh
  28. USER nobody:nogroup
  29. RUN /tmp/minify.sh
  30. ##
  31. ## Step 3 - host!
  32. ##
  33. FROM nginx:mainline-alpine AS nginx
  34. COPY --from=minify /tmp/site /usr/share/nginx/html
  35. ADD nginx.conf /etc/nginx/conf.d/site.conf