From d59b4a1ec13557d83ee5542762269b4bf9631e69 Mon Sep 17 00:00:00 2001
From: maxDorninger <97409287+maxDorninger@users.noreply.github.com>
Date: Tue, 22 Jul 2025 18:02:45 +0200
Subject: [PATCH] make port customizable via env variable
---
Writerside/mm.tree | 1 +
Writerside/topics/Custom-port.md | 4 ++++
mediamanager-backend-startup.sh | 4 +++-
3 files changed, 8 insertions(+), 1 deletion(-)
create mode 100644 Writerside/topics/Custom-port.md
diff --git a/Writerside/mm.tree b/Writerside/mm.tree
index 5e46392..8f36946 100644
--- a/Writerside/mm.tree
+++ b/Writerside/mm.tree
@@ -23,6 +23,7 @@
+
diff --git a/Writerside/topics/Custom-port.md b/Writerside/topics/Custom-port.md
new file mode 100644
index 0000000..0170d53
--- /dev/null
+++ b/Writerside/topics/Custom-port.md
@@ -0,0 +1,4 @@
+# Custom port
+
+With the env variable `PORT`, you can change the port that MediaManager listens on. The default port is `8000`.
+Note that this setting only works if you are using the Docker Image.
\ No newline at end of file
diff --git a/mediamanager-backend-startup.sh b/mediamanager-backend-startup.sh
index 7a3ca95..8d9a1f6 100644
--- a/mediamanager-backend-startup.sh
+++ b/mediamanager-backend-startup.sh
@@ -54,4 +54,6 @@ echo " Check the application logs for the login credentials."
echo " You can also register a new user and it will become admin if the email"
echo " matches one of the admin_emails in your config.toml"
echo ""
-uv run fastapi run /app/media_manager/main.py --port 8000 --proxy-headers
+
+PORT=${PORT:-8000}
+uv run fastapi run /app/media_manager/main.py --port "$PORT" --proxy-headers