diff --git a/docker/Dockerfile-frontend b/docker/Dockerfile-frontend index 6235770..749fe9f 100644 --- a/docker/Dockerfile-frontend +++ b/docker/Dockerfile-frontend @@ -2,4 +2,5 @@ FROM docker.io/nginx:stable-alpine COPY --chown=nginx:nginx frontend/dist/apps/web/ /var/www/abrechnung/ COPY --chown=nginx:nginx frontend/apps/web/src/assets/config.json /var/www/abrechnung/config.json -COPY docker/nginx-static /etc/nginx/conf.d/default.conf \ No newline at end of file +COPY docker/nginx-static /etc/nginx/conf.d/default.conf +COPY --chmod=0755 docker/entrypoint-frontend.sh /docker-entrypoint.d/99-abrechnung.sh diff --git a/docker/entrypoint-frontend.sh b/docker/entrypoint-frontend.sh new file mode 100644 index 0000000..c37563f --- /dev/null +++ b/docker/entrypoint-frontend.sh @@ -0,0 +1,7 @@ +#!/bin/sh + +CONF="/etc/nginx/conf.d/default.conf" + +[[ ! -z "${ABRECHNUNG_API__HOST}" ]] && sed -i "s/api:/${ABRECHNUNG_API__HOST}:/g" "$CONF" +[[ ! -z "${ABRECHNUNG_API__PORT}" ]] && sed -i "s/:8080/:${ABRECHNUNG_API__PORT}/g" "$CONF" +[[ ! -f "/proc/net/if_inet6" ]] && sed -i "s/listen \[::\]/#listen \[::\]/g" "$CONF"