refactor(docker): update Dockerfile and .dockerignore to streamline package installation and include necessary files

This commit is contained in:
pacnpal
2025-01-29 10:03:22 -05:00
parent 26c2adf1d5
commit c5da870762
2 changed files with 12 additions and 6 deletions

View File

@@ -14,6 +14,9 @@
!requirements.txt
!docker-entrypoint.sh
!healthcheck.py
!setup.py
!pyproject.toml
!MANIFEST.in
# VERIFICATION: Required files that MUST exist:
# - src/simpleguardhome/__init__.py
@@ -23,6 +26,7 @@
# - src/simpleguardhome/templates/index.html
# - src/simpleguardhome/favicon.ico
# - healthcheck.py
# - setup.py
# SAFETY: Never include these files even if allowed above
**/__pycache__/

View File

@@ -13,13 +13,12 @@ RUN apt-get update && \
COPY requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt
# Copy the source code
COPY . .
# Copy package files
COPY setup.py pyproject.toml MANIFEST.in ./
COPY src ./src
# Clean any previous installations and install the package
RUN pip uninstall -y simpleguardhome || true && \
pip install -e . && \
pip show simpleguardhome && \
# Install the package
RUN pip install -e . && \
python3 -c "import simpleguardhome; print('Package found at:', simpleguardhome.__file__)"
# Set up health check
@@ -36,6 +35,9 @@ ENV ADGUARD_HOST="http://localhost" \
# Expose application port
EXPOSE 8000
# Create rules_backup directory with proper permissions
RUN mkdir -p rules_backup && chmod 777 rules_backup
# Copy and set up entrypoint
COPY docker-entrypoint.sh /usr/local/bin/
RUN chmod +x /usr/local/bin/docker-entrypoint.sh