From be678c1cf0f39202c0aadeace5dd1ea15d9cb480 Mon Sep 17 00:00:00 2001 From: suricata Date: Tue, 20 Jan 2026 21:07:10 +0000 Subject: [PATCH] corrected env vars for being dynamic --- Dockerfile.fastapi | 2 ++ Dockerfile.nuxt | 4 ++-- docker-compose.yaml | 5 +++-- nuxt.config.ts | 5 +++-- server/py/fastapi_server/main.py | 3 +++ 5 files changed, 13 insertions(+), 6 deletions(-) diff --git a/Dockerfile.fastapi b/Dockerfile.fastapi index 59bc6c1..7c8672c 100644 --- a/Dockerfile.fastapi +++ b/Dockerfile.fastapi @@ -18,6 +18,8 @@ ENV DOWNLOAD_FOLDER=/tmp/downloads # Ammount (in secs) before file autodeletes ENV FILE_AUTODELETE_DELAY_SECS=300 +ENV ROOT_PATH=/ + VOLUME ["/tmp/downloads"] CMD ["python3", "main.py"] diff --git a/Dockerfile.nuxt b/Dockerfile.nuxt index cbfd5e6..77425be 100644 --- a/Dockerfile.nuxt +++ b/Dockerfile.nuxt @@ -23,9 +23,9 @@ ENV HOST=0.0.0.0 EXPOSE 3000 -ENV DOWNLOAD_FOLDER=/tmp/downloads +ENV NUXT_DOWNLOAD_FOLDER=/tmp/downloads VOLUME ["/tmp/downloads"] -ENV FASTAPI_URL=http://127.0.0.1:8000 +ENV NUXT_FASTAPI_URL=http://127.0.0.1:8000 CMD ["node", "/app/server/index.mjs"] \ No newline at end of file diff --git a/docker-compose.yaml b/docker-compose.yaml index 029e860..cf9c195 100644 --- a/docker-compose.yaml +++ b/docker-compose.yaml @@ -40,9 +40,10 @@ services: - "64002:3030" # just for the admin GUI - "6903:3000" environment: - - FASTAPI_URL=http://fastapi:8000 - - DOWNLOAD_FOLDER=/tmp/downloads + - NUXT_FASTAPI_URL=http://fastapi:8000 + - NUXT_DOWNLOAD_FOLDER=/tmp/downloads - NUXT_SESSION_PASSWORD=bc7d4da7d5f64d47aa75da92bed68cd8 + - NUXT_APP_BASE_URL=/ volumes: - music_downloads:/tmp/downloads # These 3 are just for "nuxtjs-launcher" diff --git a/nuxt.config.ts b/nuxt.config.ts index d0840ca..7302c85 100644 --- a/nuxt.config.ts +++ b/nuxt.config.ts @@ -16,7 +16,8 @@ export default defineNuxtConfig({ plugins: [ tailwindcss() ] }, runtimeConfig: { - fastapi_url: process.env.FASTAPI_URL || "http://fastapi:8000", - download_path: process.env.DOWNLOAD_FOLDER || "/tmp/downloads" + // overridable by NUXT_variable + fastapi_url: "http://fastapi:8000", + download_path: "/tmp/downloads" } }) \ No newline at end of file diff --git a/server/py/fastapi_server/main.py b/server/py/fastapi_server/main.py index e687923..f1e2472 100644 --- a/server/py/fastapi_server/main.py +++ b/server/py/fastapi_server/main.py @@ -16,11 +16,14 @@ import db_setup as db # Import the entire db_setup module from user_mgmt import * from media_mgmt import * +pathRoot = os.environ.get("ROOT_PATH","/") + app = FastAPI( title="YT2MP3 API", description="Simple API to download YouTube videos as MP3.", version="1.0.0", license_info="MIT", + root_path=pathRoot, lifespan=db.lifespan )