From 71b119ca34e0a40b75ec0dfd53d0f251580860c5 Mon Sep 17 00:00:00 2001
From: Dominik George <dominik.george@teckids.org>
Date: Tue, 9 Apr 2024 23:45:42 +0200
Subject: [PATCH] Allow different base URLs in caddy and build

---
 Caddyfile  | 6 +++++-
 Dockerfile | 4 +++-
 2 files changed, 8 insertions(+), 2 deletions(-)

diff --git a/Caddyfile b/Caddyfile
index 7416457a..bbd8df8e 100644
--- a/Caddyfile
+++ b/Caddyfile
@@ -1,4 +1,8 @@
-http://teckids.org {
+http:// {
+    error 404
+}
+
+http://teckids.org, http://*.review.teckids.org {
     root * /srv
     encode zstd gzip
     file_server
diff --git a/Dockerfile b/Dockerfile
index 54609ce1..21ced1fb 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -1,12 +1,14 @@
 FROM alpine:latest AS build
 
+ARG BASE_URL=https://teckids.org
+
 RUN apk add --update-cache --repository http://dl-cdn.alpinelinux.org/alpine/edge/community/ zola yarn
 
 COPY . /src
 WORKDIR /src
 
 RUN yarn install
-RUN zola build
+RUN zola build -u $BASE_URL
 
 
 FROM caddy:alpine AS serve
-- 
GitLab