diff --git a/Dockerfile b/Dockerfile index 8ac89c2..eeb59f2 100644 --- a/Dockerfile +++ b/Dockerfile @@ -14,7 +14,10 @@ COPY requirements.txt . RUN pip install --no-cache-dir -r requirements.txt # Copy source code -COPY src/simpleguardhome /app/simpleguardhome/ +COPY src /app/src + +# Create rules_backup directory with proper permissions +RUN mkdir -p rules_backup && chmod 777 rules_backup # Set up health check COPY healthcheck.py /usr/local/bin/ @@ -34,4 +37,7 @@ EXPOSE 8000 COPY docker-entrypoint.sh /usr/local/bin/ RUN chmod +x /usr/local/bin/docker-entrypoint.sh -ENTRYPOINT ["docker-entrypoint.sh"] \ No newline at end of file +ENTRYPOINT ["docker-entrypoint.sh"] + +# Mark rules_backup as a volume +VOLUME ["/app/rules_backup"] \ No newline at end of file diff --git a/docker-entrypoint.sh b/docker-entrypoint.sh index ec61f48..10c113f 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..." -# Start the application -exec python3 -m uvicorn simpleguardhome.main:app --host 0.0.0.0 --port 8000 \ No newline at end of file +# 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