FROM caddy:2 ARG WEBSITE_ARCHIVE_URL ARG WEBSITE_ARCHIVE_FOLDER RUN apk update && apk upgrade && set -eu RUN apk add zola --repository http://dl-cdn.alpinelinux.org/alpine/edge/community/ && apk add tar gzip curl COPY archive-token.txt /archive-token.txt RUN curl -X "GET" -H "Authorization: token $(cat /archive-token.txt)" "$WEBSITE_ARCHIVE_URL" 2>/dev/null | gzip --decompress --stdout - | tar xf - ; rm /archive-token.txt WORKDIR /srv/$WEBSITE_ARCHIVE_FOLDER RUN zola build EXPOSE 80/tcp CMD ["caddy", "file-server", "--root", "public"]