From 97b139d592c4c80d289f75f903ee1184768c2081 Mon Sep 17 00:00:00 2001 From: Jonas Tobias Hopusch Date: Tue, 22 Feb 2022 12:18:04 +0100 Subject: [PATCH] Attempt to introduce Caddyfile for websites into build process --- Dockerfile | 4 ++++ build-kanzleiseite.sh | 1 + build-personalsite.sh | 1 + 3 files changed, 6 insertions(+) diff --git a/Dockerfile b/Dockerfile index e377744..f8f9c81 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,6 +1,7 @@ FROM alpine:latest AS builder ARG WEBSITE_ARCHIVE_URL ARG WEBSITE_ARCHIVE_FOLDER +ARG WEBSITE_HOST 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 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 ARG WEBSITE_ARCHIVE_FOLDER COPY --from=builder /$WEBSITE_ARCHIVE_FOLDER/public /site +COPY --from=builder /tmp/Caddyfile ./ EXPOSE 80/tcp diff --git a/build-kanzleiseite.sh b/build-kanzleiseite.sh index ec8678b..5188ba7 100755 --- a/build-kanzleiseite.sh +++ b/build-kanzleiseite.sh @@ -3,4 +3,5 @@ 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_FOLDER="kanzleiseite" \ + --build-arg WEBSITE_HOST="www.hopusch.de" \ . diff --git a/build-personalsite.sh b/build-personalsite.sh index 0e6efd0..88f1b1a 100755 --- a/build-personalsite.sh +++ b/build-personalsite.sh @@ -3,4 +3,5 @@ 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_FOLDER="my-website" \ + --build-arg WEBSITE_HOST="www.jotoho.de" \ .