Fix Docker build issues

- Update Dockerfile to handle missing config directory gracefully
- Copy example configs as templates instead of requiring real configs
- Add comprehensive .dockerignore to exclude sensitive files
- Resolves Docker build failure in CI/CD workflows
This commit is contained in:
Sammy Farida
2025-10-21 14:42:10 -04:00
parent 0b86327c73
commit a4571ef48e
2 changed files with 88 additions and 1 deletions
+82
View File
@@ -0,0 +1,82 @@
# Git
.git
.gitignore
# Python
__pycache__/
*.py[cod]
*$py.class
*.so
.Python
build/
develop-eggs/
dist/
downloads/
eggs/
.eggs/
lib/
lib64/
parts/
sdist/
var/
wheels/
*.egg-info/
.installed.cfg
*.egg
MANIFEST
# Virtual environments
.venv/
venv/
ENV/
env/
# IDEs
.vscode/
.idea/
*.swp
*.swo
*~
.DS_Store
# Testing
.pytest_cache/
.coverage
htmlcov/
.tox/
.nox/
# mypy
.mypy_cache/
.dmypy.json
dmypy.json
# Secrets and credentials (these should be mounted at runtime)
config/servers.yml
config/credentials.yml
config/policy.yml
keys/
secrets/
*.pem
*.key
*_rsa
*_ed25519
*_ecdsa
known_hosts
# Logs
*.log
# Docker
Dockerfile
.dockerignore
docker-compose.yml
compose/
# Documentation
docs/
*.md
!README.md
# CI/CD
.github/
+6 -1
View File
@@ -21,8 +21,13 @@ WORKDIR /app
# Copy project
COPY pyproject.toml README.md LICENSE /app/
COPY src /app/src
COPY config /app/config
COPY examples /app/examples
# Create config directory and copy example configs if they exist
RUN mkdir -p /app/config
COPY examples/example-servers.yml /app/config/servers.yml.example
COPY examples/example-credentials.yml /app/config/credentials.yml.example
COPY examples/example-policy.yml /app/config/policy.yml.example
ENV PATH="/home/appuser/.local/bin:$PATH"
RUN pip install --no-cache-dir --upgrade pip && \