Skip to content

Commit b00db5d

Browse files
committed
fix(docker): add .dockerignore to prevent secret leakage in image layers
Add .dockerignore to exclude .git/ and other unnecessary files from the Docker build context. The ADD directive was copying the entire working directory including .git/config, which contained personal access tokens that were exposed in image layers and detected by trufflehog scans. Also excludes CI/CD configs, test files, Python artifacts, virtual environments, and build metadata to reduce image size. Signed-off-by: Giulio Calacoci <giulio.calacoci@enterprisedb.com>
1 parent e3d2e35 commit b00db5d

File tree

1 file changed

+41
-0
lines changed

1 file changed

+41
-0
lines changed

.dockerignore

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
# Version control
2+
.git/
3+
.gitignore
4+
5+
# CI/CD and development
6+
.github/
7+
.vscode/
8+
.idea/
9+
*.swp
10+
*.swo
11+
12+
# Python artifacts
13+
__pycache__/
14+
*.pyc
15+
*.pyo
16+
*.egg-info/
17+
dist/
18+
build/
19+
.eggs/
20+
21+
# Virtual environments
22+
.venv/
23+
venv/
24+
25+
# Test and coverage
26+
tests/
27+
.pytest_cache/
28+
coverage.xml
29+
pytest.xml
30+
htmlcov/
31+
.coverage
32+
33+
# Documentation and metadata (keep README.md — required by pyproject.toml)
34+
CHANGELOG.md
35+
CONTRIBUTING.md
36+
LICENSE
37+
personal/
38+
39+
# Docker (prevent recursive builds)
40+
Dockerfile
41+
docker-compose*.yml

0 commit comments

Comments
 (0)