From 5430ec6ad43fa44cf1b8a4ff266b707ab86a804a Mon Sep 17 00:00:00 2001 From: pacnpal <183241239+pacnpal@users.noreply.github.com> Date: Wed, 29 Jan 2025 12:27:45 -0500 Subject: [PATCH] refactor(docker): update Dockerfile and entrypoint script for improved package verification and health check command --- Dockerfile | 4 ++-- docker-entrypoint.sh | 5 ++++- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/Dockerfile b/Dockerfile index c7b469a..644f459 100644 --- a/Dockerfile +++ b/Dockerfile @@ -18,7 +18,7 @@ COPY setup.py pyproject.toml MANIFEST.in ./ COPY src ./src # Install the package -RUN pip install -e /app && \ +RUN pip install -e . && \ python3 -c "import simpleguardhome; print('Package found at:', simpleguardhome.__file__)" # Set up health check @@ -26,7 +26,7 @@ COPY healthcheck.py /usr/local/bin/ RUN chmod +x /usr/local/bin/healthcheck.py HEALTHCHECK --interval=30s --timeout=10s --start-period=5s --retries=3 \ - CMD python3 /usr/local/bin/healthcheck.py + CMD ["python3", "/usr/local/bin/healthcheck.py"] # Environment setup ENV ADGUARD_HOST="http://localhost" \ diff --git a/docker-entrypoint.sh b/docker-entrypoint.sh index 92cd17e..23fbabd 100644 --- a/docker-entrypoint.sh +++ b/docker-entrypoint.sh @@ -3,9 +3,12 @@ set -e echo "[$(date '+%Y-%m-%d %H:%M:%S')] Starting SimpleGuardHome..." +# Ensure proper Python path +export PYTHONPATH="/app:${PYTHONPATH:-}" + # Verify package can be imported echo "Verifying package installation..." -python3 -c "import simpleguardhome" || exit 1 +python3 -c "import simpleguardhome; print('Package found at:', simpleguardhome.__file__)" # Start the application echo "Starting SimpleGuardHome server..."