From 782c765685dd60d4ec5fb6a10e0ef163ef27f5ca Mon Sep 17 00:00:00 2001 From: Matthias Mair Date: Fri, 20 Feb 2026 11:10:49 +0100 Subject: [PATCH] make INVENTREE_WEB_PORT more usefull (#11352) * make INVENTREE_WEB_PORT more usefull * Update contrib/container/docker-compose.yml Co-authored-by: Philipp Fruck * revert change * Fix indentation for environment variable in docker-compose --------- Co-authored-by: Philipp Fruck --- contrib/container/.env | 1 + contrib/container/Caddyfile | 1 + contrib/container/docker-compose.yml | 4 +++- 3 files changed, 5 insertions(+), 1 deletion(-) diff --git a/contrib/container/.env b/contrib/container/.env index b07299dc7d..33ffc7e5ee 100644 --- a/contrib/container/.env +++ b/contrib/container/.env @@ -12,6 +12,7 @@ INVENTREE_TAG=stable INVENTREE_SITE_URL="http://inventree.localhost" #INVENTREE_SITE_URL="http://192.168.1.2" # You can specify a local IP address here #INVENTREE_SITE_URL="https://inventree.my-domain.com" # Or a public domain name (which you control) +INVENTREE_WEB_PORT=8000 # InvenTree proxy forwarding settings INVENTREE_USE_X_FORWARDED_HOST=True diff --git a/contrib/container/Caddyfile b/contrib/container/Caddyfile index 71a6a0efed..d854703722 100644 --- a/contrib/container/Caddyfile +++ b/contrib/container/Caddyfile @@ -2,6 +2,7 @@ # The following environment variables may be used: # - INVENTREE_SITE_URL: The upstream URL of the InvenTree site (default: inventree.localhost) # - INVENTREE_SERVER: The internal URL of the InvenTree container (default: http://inventree-server:8000) +# - INVENTREE_WEB_PORT: The port on which the InvenTree web server listens (default: 8000) # # Note that while this file is a good starting point, it may need to be modified to suit your specific requirements # diff --git a/contrib/container/docker-compose.yml b/contrib/container/docker-compose.yml index ca0fe6cd19..9b8abc5b05 100644 --- a/contrib/container/docker-compose.yml +++ b/contrib/container/docker-compose.yml @@ -76,12 +76,14 @@ services: container_name: inventree-server # Only change this port if you understand the stack. expose: - - 8000 + - ${INVENTREE_WEB_PORT:-8000} depends_on: - inventree-db - inventree-cache env_file: - .env + environment: + INVENTREE_SERVER: http://inventree-server:${INVENTREE_WEB_PORT} volumes: # Data volume must map to /home/inventree/data - ${INVENTREE_EXT_VOLUME}:/home/inventree/data:z