1
0
Fork 0
site-deployer/Dockerfile

27 lines
852 B
Text
Raw Normal View History

FROM alpine:latest AS builder
2021-12-05 16:45:50 +01:00
ARG WEBSITE_ARCHIVE_URL
ARG WEBSITE_ARCHIVE_FOLDER
ARG WEBSITE_HOST
2021-12-05 16:45:50 +01:00
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 /$WEBSITE_ARCHIVE_FOLDER
2021-12-05 17:13:48 +01:00
RUN zola build ; rm public/404.html
2021-12-05 16:45:50 +01:00
RUN wget -O /tmp/Caddyfile "https://gitea.jotoho.de/jotoho/site-deployer/raw/branch/master/$WEBSITE_HOST/Caddyfile"
FROM caddy:2
ARG WEBSITE_ARCHIVE_FOLDER
COPY --from=builder /$WEBSITE_ARCHIVE_FOLDER/public /site
COPY --from=builder /tmp/Caddyfile ./
2021-12-05 16:45:50 +01:00
EXPOSE 80/tcp
CMD ["caddy", "run", "--config", "./Caddyfile"]