From 3371f5dd4bda576384efbcdf2de8d0e9bab43538 Mon Sep 17 00:00:00 2001 From: Depeng Sun Date: Fri, 7 Nov 2025 00:54:31 +1030 Subject: [PATCH] Revert "refactor: update get_redis return type and clean up main.py imports (#7)" This reverts commit cf8104c01aacbf4c5febdcfcd56d3f385617fbc3. --- Dockerfile.uat | 7 ++----- app/infrastructure/redis_client.py | 2 +- app/main.py | 1 + 3 files changed, 4 insertions(+), 6 deletions(-) diff --git a/Dockerfile.uat b/Dockerfile.uat index 628ddc2..bd0ff84 100644 --- a/Dockerfile.uat +++ b/Dockerfile.uat @@ -10,8 +10,5 @@ COPY . /app WORKDIR /app RUN uv sync --frozen --no-cache -# Set PYTHONPATH to include the root directory -ENV PYTHONPATH=/app - -# Run the application using uvicorn with the correct module path -CMD ["/app/.venv/bin/uvicorn", "app.main:app", "--host", "0.0.0.0", "--port", "8000"] \ No newline at end of file +# Run the application. +CMD ["/app/.venv/bin/fastapi", "run", "app/main.py", "--port", "8000", "--host", "0.0.0.0"] \ No newline at end of file diff --git a/app/infrastructure/redis_client.py b/app/infrastructure/redis_client.py index 57e1ad6..3e2e22f 100644 --- a/app/infrastructure/redis_client.py +++ b/app/infrastructure/redis_client.py @@ -5,7 +5,7 @@ @lru_cache -def get_redis() -> Redis: +def get_redis() -> Redis[str]: if settings.redis_url: return Redis.from_url( settings.redis_url, diff --git a/app/main.py b/app/main.py index 183c277..51705de 100644 --- a/app/main.py +++ b/app/main.py @@ -10,6 +10,7 @@ app_dir = Path(__file__).parent sys.path.insert(0, str(app_dir)) + settings = get_settings() app = FastAPI(