Skip to content

Commit

Permalink
Merge pull request #199 from RicardoJeronimo/docker
Browse files Browse the repository at this point in the history
Dynamically change Nginx configuration
  • Loading branch information
mikonse authored Jan 25, 2024
2 parents e4207b4 + 6eb4889 commit ea66dd7
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
3 changes: 2 additions & 1 deletion docker/Dockerfile-frontend
Original file line number Diff line number Diff line change
Expand Up @@ -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
COPY docker/nginx-static /etc/nginx/conf.d/default.conf
COPY --chmod=0755 docker/entrypoint-frontend.sh /docker-entrypoint.d/99-abrechnung.sh
7 changes: 7 additions & 0 deletions docker/entrypoint-frontend.sh
Original file line number Diff line number Diff line change
@@ -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"

0 comments on commit ea66dd7

Please sign in to comment.