From 18d11252439ea6048da304d071aaafbbf4073093 Mon Sep 17 00:00:00 2001 From: pacnpal <183241239+pacnpal@users.noreply.github.com> Date: Wed, 29 Jan 2025 09:47:14 -0500 Subject: [PATCH] refactor(docker): simplify Dockerfile by copying package directly for easier imports and streamline entrypoint script --- Dockerfile | 4 ++-- docker-entrypoint.sh | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Dockerfile b/Dockerfile index eeb59f2..91eaadf 100644 --- a/Dockerfile +++ b/Dockerfile @@ -13,8 +13,8 @@ RUN apt-get update && \ COPY requirements.txt . RUN pip install --no-cache-dir -r requirements.txt -# Copy source code -COPY src /app/src +# Copy the package directly to /app for simpler imports +COPY src/simpleguardhome /app/simpleguardhome # Create rules_backup directory with proper permissions RUN mkdir -p rules_backup && chmod 777 rules_backup diff --git a/docker-entrypoint.sh b/docker-entrypoint.sh index 10c113f..cf42997 100644 --- a/docker-entrypoint.sh +++ b/docker-entrypoint.sh @@ -3,5 +3,5 @@ set -e echo "[$(date '+%Y-%m-%d %H:%M:%S')] Starting SimpleGuardHome..." -# Run the app with src in Python path to find the module -PYTHONPATH=/app/src exec python3 -m uvicorn simpleguardhome.main:app --host 0.0.0.0 --port 8000 \ No newline at end of file +# Just run uvicorn pointing to the app +exec python3 -m uvicorn simpleguardhome.main:app --host 0.0.0.0 --port 8000 \ No newline at end of file