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.

Dockerfile 815B

1234567891011121314151617181920212223242526272829303132333435
  1. ##
  2. ## Step 1 - add content and build with Hugo
  3. ##
  4. FROM r.c5h.io/hugo as hugo
  5. ADD site /tmp/site
  6. RUN hugo -v -s /tmp/site -d /tmp/hugo && \
  7. cp /tmp/hugo/post/index.xml /tmp/hugo/feed.xml && \
  8. cp /tmp/hugo/post/index.xml /tmp/hugo/index.xml
  9. ##
  10. ## Step 2 - compress, minify, etc
  11. ##
  12. FROM debian:stretch as minify
  13. RUN apt-get update \
  14. && DEBIAN_FRONTEND=noninteractive apt-get -qq install -y --no-install-recommends yui-compressor tidy webp \
  15. && rm -rf /var/lib/apt/lists/*
  16. COPY --from=hugo /tmp/hugo /tmp/site
  17. ADD minify.sh /tmp/minify.sh
  18. RUN chown -R nobody:nogroup /tmp/site && chmod +x /tmp/minify.sh
  19. USER nobody:nogroup
  20. RUN /tmp/minify.sh
  21. ##
  22. ## Step 3 - host!
  23. ##
  24. FROM nginx:mainline-alpine AS nginx
  25. COPY --from=minify /tmp/site /usr/share/nginx/html
  26. ADD nginx.conf /etc/nginx/nginx.conf
  27. VOLUME /logs