diff --git a/Dockerfile b/Dockerfile index 504781d..580c1a2 100644 --- a/Dockerfile +++ b/Dockerfile @@ -18,3 +18,12 @@ LABEL org.opencontainers.image.source=https://git.wtf-eg.de/kompetenzinventar/ki LABEL org.opencontainers.image.url=https://git.wtf-eg.de/kompetenzinventar/ki-frontend LABEL org.opencontainers.image.documentation=https://git.wtf-eg.de/kompetenzinventar/ki-frontend#docker LABEL org.opencontainers.image.vendor="WTF Kooperative eG" + +ENV KI_BACKEND_URL + +WORKDIR /usr/share/nginx/html +ENTRYPOINT ["/entrypoint.sh"]A + +COPY etc/nginx/conf.d/default.conf /etc/nginx/conf.d/default.conf +COPY entrypoint.sh / +COPY --from=builder /dist . diff --git a/entrypoint.sh b/entrypoint.sh new file mode 100755 index 0000000..3a04a38 --- /dev/null +++ b/entrypoint.sh @@ -0,0 +1,9 @@ +#!/bin/bash + +set -o errexit + +: ${KI_API_URL:=http://ki-backend:5000} + +sed -e "s%\$KI_API_URL%$KI_API_URL%g" config.js.in > config.js + +exec "$@" diff --git a/public/config.js.in b/public/config.js.in new file mode 100644 index 0000000..af275e5 --- /dev/null +++ b/public/config.js.in @@ -0,0 +1,7 @@ +// SPDX-FileCopyrightText: WTF Kooperative eG +// +// SPDX-License-Identifier: AGPL-3.0-or-later + +window.ki = { + apiUrl: "$KI_API_URL" +}