1
0
Fork 0

Simplify Dockerfile

This commit is contained in:
Jonas Tobias Hopusch 2024-06-05 18:34:16 +02:00
parent 2d6a523f38
commit 2ff4ca2325
Signed by: jotoho
GPG key ID: 913BDF1196DCF600

View file

@ -3,15 +3,19 @@ ARG WEBSITE_ARCHIVE_URL
ARG WEBSITE_ARCHIVE_FOLDER ARG WEBSITE_ARCHIVE_FOLDER
ARG WEBSITE_HOST ARG WEBSITE_HOST
RUN apk update && apk upgrade && set -eu RUN apk update
RUN apk upgrade
RUN apk add zola --repository http://dl-cdn.alpinelinux.org/alpine/edge/community/ && apk add tar gzip curl RUN set -eux
RUN apk add tar gzip curl
RUN apk add zola --repository http://dl-cdn.alpinelinux.org/alpine/edge/community/
COPY archive-token.txt /archive-token.txt 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 RUN curl -X "GET" -H "Authorization: token $(cat /archive-token.txt)" "$WEBSITE_ARCHIVE_URL" | gzip --decompress --stdout - | tar xf -
RUN rm /archive-token.txt
WORKDIR /$WEBSITE_ARCHIVE_FOLDER WORKDIR /$WEBSITE_ARCHIVE_FOLDER
RUN zola build ; rm public/404.html RUN zola build
RUN rm public/404.html
RUN wget -O /tmp/Caddyfile "https://git.jotoho.de/jotoho/site-deployer/raw/branch/master/$WEBSITE_HOST/Caddyfile" >/dev/null 2>&1 RUN wget -O /tmp/Caddyfile "https://git.jotoho.de/jotoho/site-deployer/raw/branch/master/$WEBSITE_HOST/Caddyfile" >/dev/null 2>&1