1
0
Fork 0

Attempt to introduce Caddyfile for websites into build process

This commit is contained in:
Jonas Tobias Hopusch 2022-02-22 12:18:04 +01:00
parent 51e6f7a16e
commit 97b139d592
Failed to generate hash of commit
3 changed files with 6 additions and 0 deletions

View file

@ -1,6 +1,7 @@
FROM alpine:latest AS builder FROM alpine:latest AS builder
ARG WEBSITE_ARCHIVE_URL ARG WEBSITE_ARCHIVE_URL
ARG WEBSITE_ARCHIVE_FOLDER ARG WEBSITE_ARCHIVE_FOLDER
ARG WEBSITE_HOST
RUN apk update && apk upgrade && set -eu RUN apk update && apk upgrade && set -eu
@ -12,10 +13,13 @@ RUN curl -X "GET" -H "Authorization: token $(cat /archive-token.txt)" "$WEBSITE_
WORKDIR /$WEBSITE_ARCHIVE_FOLDER WORKDIR /$WEBSITE_ARCHIVE_FOLDER
RUN zola build ; rm public/404.html RUN zola build ; rm public/404.html
RUN wget -O /tmp/Caddyfile "https://gitea.jotoho.de/jotoho/site-deployer/raw/branch/master/$WEBSITE_HOST/Caddyfile"
FROM caddy:2 FROM caddy:2
ARG WEBSITE_ARCHIVE_FOLDER ARG WEBSITE_ARCHIVE_FOLDER
COPY --from=builder /$WEBSITE_ARCHIVE_FOLDER/public /site COPY --from=builder /$WEBSITE_ARCHIVE_FOLDER/public /site
COPY --from=builder /tmp/Caddyfile ./
EXPOSE 80/tcp EXPOSE 80/tcp

View file

@ -3,4 +3,5 @@
docker build --no-cache --pull -t jotoho/www.hopusch.de:latest \ docker build --no-cache --pull -t jotoho/www.hopusch.de:latest \
--build-arg WEBSITE_ARCHIVE_URL="https://gitea.jotoho.de/api/v1/repos/jotoho/kanzleiseite/archive/master.tar.gz" \ --build-arg WEBSITE_ARCHIVE_URL="https://gitea.jotoho.de/api/v1/repos/jotoho/kanzleiseite/archive/master.tar.gz" \
--build-arg WEBSITE_ARCHIVE_FOLDER="kanzleiseite" \ --build-arg WEBSITE_ARCHIVE_FOLDER="kanzleiseite" \
--build-arg WEBSITE_HOST="www.hopusch.de" \
. .

View file

@ -3,4 +3,5 @@
docker build --no-cache --pull -t jotoho/www.jotoho.de:latest \ docker build --no-cache --pull -t jotoho/www.jotoho.de:latest \
--build-arg WEBSITE_ARCHIVE_URL="https://gitea.jotoho.de/api/v1/repos/jotoho/my-website/archive/master.tar.gz" \ --build-arg WEBSITE_ARCHIVE_URL="https://gitea.jotoho.de/api/v1/repos/jotoho/my-website/archive/master.tar.gz" \
--build-arg WEBSITE_ARCHIVE_FOLDER="my-website" \ --build-arg WEBSITE_ARCHIVE_FOLDER="my-website" \
--build-arg WEBSITE_HOST="www.jotoho.de" \
. .