mirror of
https://github.com/KevinMidboe/immich.git
synced 2025-10-29 17:40:28 +00:00
feat(deployment) Allow overriding service host and ports with env variables (#930)
* Add proxy changes * Add web changes * Add microservices changes * Add examples * Add header comment to nginx config * Use URLs instead of host and port
This commit is contained in:
@@ -3,6 +3,7 @@ FROM docker.io/nginxinc/nginx-unprivileged:latest
|
||||
COPY LICENSE /licenses/LICENSE.txt
|
||||
COPY LICENSE /LICENSE
|
||||
|
||||
COPY nginx.conf "/etc/nginx/nginx.conf"
|
||||
COPY nginx.conf "/etc/nginx/nginx.conf.template"
|
||||
COPY start.sh /start.sh
|
||||
|
||||
CMD nginx -g "daemon off;"
|
||||
CMD /start.sh
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
|
||||
|
||||
# NOTE: This file is generated on startup. See /start.sh
|
||||
worker_processes auto;
|
||||
error_log /var/log/nginx/error.log;
|
||||
pid /tmp/nginx.pid;
|
||||
@@ -62,7 +61,7 @@ http {
|
||||
|
||||
rewrite /api/(.*) /$1 break;
|
||||
|
||||
proxy_pass http://immich-server:3001;
|
||||
proxy_pass $IMMICH_SERVER_URL;
|
||||
}
|
||||
|
||||
location / {
|
||||
@@ -87,7 +86,7 @@ http {
|
||||
proxy_set_header Connection "upgrade";
|
||||
proxy_set_header Host $host;
|
||||
|
||||
proxy_pass http://immich-web:3000;
|
||||
proxy_pass $IMMICH_WEB_URL;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
9
nginx/start.sh
Executable file
9
nginx/start.sh
Executable file
@@ -0,0 +1,9 @@
|
||||
#! /bin/bash
|
||||
set -e
|
||||
|
||||
export IMMICH_WEB_URL=${IMMICH_WEB_URL:-http://immich-web:3000}
|
||||
export IMMICH_SERVER_URL=${IMMICH_SERVER_URL:-http://immich-server:3001}
|
||||
|
||||
envsubst '$IMMICH_WEB_URL $IMMICH_SERVER_URL' < /etc/nginx/nginx.conf.template > /etc/nginx/nginx.conf
|
||||
|
||||
exec nginx -g 'daemon off;'
|
||||
Reference in New Issue
Block a user