2022-11-09 04:11:32 -07:00
|
|
|
#! /bin/bash
|
|
|
|
set -e
|
|
|
|
|
|
|
|
export IMMICH_WEB_URL=${IMMICH_WEB_URL:-http://immich-web:3000}
|
2022-12-29 19:09:38 -07:00
|
|
|
IMMICH_WEB_SCHEME=$(echo "$IMMICH_WEB_URL" | grep -Eo '^https?://' || echo "http://")
|
|
|
|
export IMMICH_WEB_SCHEME
|
|
|
|
IMMICH_WEB_HOST=$(echo "$IMMICH_WEB_URL" | cut -d '/' -f 3)
|
|
|
|
export IMMICH_WEB_HOST
|
2022-11-09 04:11:32 -07:00
|
|
|
export IMMICH_SERVER_URL=${IMMICH_SERVER_URL:-http://immich-server:3001}
|
2022-12-29 19:09:38 -07:00
|
|
|
IMMICH_SERVER_SCHEME=$(echo "$IMMICH_WEB_URL" | grep -Eo '^https?://' || echo "http://")
|
|
|
|
export IMMICH_SERVER_SCHEME
|
|
|
|
IMMICH_SERVER_HOST=$(echo "$IMMICH_SERVER_URL" | cut -d '/' -f 3)
|
|
|
|
export IMMICH_SERVER_HOST
|
2022-11-09 04:11:32 -07:00
|
|
|
|
2022-12-29 19:09:38 -07:00
|
|
|
envsubst '$IMMICH_WEB_SCHEME $IMMICH_WEB_HOST $IMMICH_SERVER_SCHEME $IMMICH_SERVER_HOST' < /etc/nginx/nginx.conf.template > /etc/nginx/nginx.conf
|
2022-11-09 04:11:32 -07:00
|
|
|
|
|
|
|
exec nginx -g 'daemon off;'
|