mirror of
https://github.com/pacnpal/simpleguardhome.git
synced 2025-12-20 04:21:13 -05:00
feat(docker): update .dockerignore for improved file management; enhance Dockerfile with better debugging outputs and verification steps
This commit is contained in:
@@ -1,65 +1,24 @@
|
|||||||
# Version control
|
# Ignore everything by default
|
||||||
.git
|
*
|
||||||
.gitignore
|
|
||||||
.gitattributes
|
|
||||||
|
|
||||||
# Python
|
# Explicitly allow required files
|
||||||
__pycache__/
|
|
||||||
*.py[cod]
|
|
||||||
*$py.class
|
|
||||||
*.so
|
|
||||||
.Python
|
|
||||||
venv/
|
|
||||||
env/
|
|
||||||
build/
|
|
||||||
develop-eggs/
|
|
||||||
dist/
|
|
||||||
downloads/
|
|
||||||
eggs/
|
|
||||||
.eggs/
|
|
||||||
lib/
|
|
||||||
lib64/
|
|
||||||
parts/
|
|
||||||
sdist/
|
|
||||||
var/
|
|
||||||
wheels/
|
|
||||||
*.egg-info/
|
|
||||||
.installed.cfg
|
|
||||||
*.egg
|
|
||||||
MANIFEST
|
|
||||||
|
|
||||||
# IDE
|
|
||||||
.idea/
|
|
||||||
.vscode/
|
|
||||||
*.swp
|
|
||||||
*.swo
|
|
||||||
.project
|
|
||||||
.pydevproject
|
|
||||||
.settings/
|
|
||||||
*.sublime-workspace
|
|
||||||
*.sublime-project
|
|
||||||
|
|
||||||
# Test
|
|
||||||
.pytest_cache/
|
|
||||||
.coverage
|
|
||||||
htmlcov/
|
|
||||||
.tox/
|
|
||||||
.nox/
|
|
||||||
coverage.xml
|
|
||||||
*.cover
|
|
||||||
*.py,cover
|
|
||||||
.hypothesis/
|
|
||||||
|
|
||||||
# Project specific
|
|
||||||
rules_backup/
|
|
||||||
.env
|
|
||||||
|
|
||||||
# Keep these files
|
|
||||||
!src/
|
|
||||||
!src/simpleguardhome/
|
!src/simpleguardhome/
|
||||||
|
!src/simpleguardhome/**
|
||||||
!requirements.txt
|
!requirements.txt
|
||||||
!setup.py
|
!setup.py
|
||||||
!pyproject.toml
|
!pyproject.toml
|
||||||
!MANIFEST.in
|
!MANIFEST.in
|
||||||
!LICENSE
|
!LICENSE
|
||||||
!README.md
|
!README.md
|
||||||
|
!docker-entrypoint.sh
|
||||||
|
|
||||||
|
# Still exclude these even if in allowed directories
|
||||||
|
**/__pycache__
|
||||||
|
**/*.pyc
|
||||||
|
**/*.pyo
|
||||||
|
**/*.pyd
|
||||||
|
**/.Python
|
||||||
|
**/*.so
|
||||||
|
**/*.egg
|
||||||
|
**/*.egg-info
|
||||||
|
**/*.egg-info/
|
||||||
22
Dockerfile
22
Dockerfile
@@ -39,20 +39,21 @@ WORKDIR /app
|
|||||||
COPY --from=builder /usr/local/lib/python3.11/site-packages/ /usr/local/lib/python3.11/site-packages/
|
COPY --from=builder /usr/local/lib/python3.11/site-packages/ /usr/local/lib/python3.11/site-packages/
|
||||||
COPY --from=builder /usr/local/bin/ /usr/local/bin/
|
COPY --from=builder /usr/local/bin/ /usr/local/bin/
|
||||||
|
|
||||||
# Debug: Show current state
|
# Debug: Show initial state
|
||||||
RUN echo "Initial directory structure:" && \
|
RUN echo "Initial directory structure:" && \
|
||||||
tree /app || true
|
tree /app || true
|
||||||
|
|
||||||
# Copy project files
|
# First copy the package source directory
|
||||||
COPY . /app/
|
COPY src/ /app/src/
|
||||||
|
|
||||||
# Debug: Show copied files
|
# Copy project files
|
||||||
RUN echo "After copying project files:" && \
|
COPY pyproject.toml setup.py MANIFEST.in README.md LICENSE docker-entrypoint.sh ./
|
||||||
|
|
||||||
|
# Debug: Verify directory structure
|
||||||
|
RUN echo "After copying files:" && \
|
||||||
tree /app && \
|
tree /app && \
|
||||||
echo "Listing src directory:" && \
|
echo "Verifying package directory:" && \
|
||||||
ls -la /app/src && \
|
ls -la /app/src/simpleguardhome/
|
||||||
echo "Listing package directory:" && \
|
|
||||||
ls -la /app/src/simpleguardhome
|
|
||||||
|
|
||||||
# Set permissions
|
# Set permissions
|
||||||
RUN chmod -R 755 /app && \
|
RUN chmod -R 755 /app && \
|
||||||
@@ -69,7 +70,8 @@ RUN set -ex && \
|
|||||||
echo "Verifying installation..." && \
|
echo "Verifying installation..." && \
|
||||||
python3 -c "import sys; print('Python path:', sys.path)" && \
|
python3 -c "import sys; print('Python path:', sys.path)" && \
|
||||||
python3 -c "import simpleguardhome; print('Package found at:', simpleguardhome.__file__)" && \
|
python3 -c "import simpleguardhome; print('Package found at:', simpleguardhome.__file__)" && \
|
||||||
python3 -c "from simpleguardhome.main import app; print('App imported successfully')"
|
python3 -c "from simpleguardhome.main import app; print('App imported successfully')" && \
|
||||||
|
echo "Package installation successful"
|
||||||
|
|
||||||
# Create rules backup directory
|
# Create rules backup directory
|
||||||
RUN mkdir -p /app/rules_backup && \
|
RUN mkdir -p /app/rules_backup && \
|
||||||
|
|||||||
Reference in New Issue
Block a user