Frameworks

Django .dockerignore

.dockerignore for frameworks projects

View on GitHub

.dockerignore Content

# ============================================================================
# Created by https://dockerignore.com/
# COMPREHENSIVE FRAMEWORK TEMPLATE for Django
# Website: https://www.djangoproject.com/
# Repository: https://github.com/django/django
# ============================================================================

# ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
# TEMPLATE OVERVIEW & USAGE NOTES
# ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
# • TEMPLATE TYPE: COMPREHENSIVE FRAMEWORK TEMPLATE
# • PURPOSE: Django web framework specific ignore patterns
# • DESIGN PHILOSOPHY: Self-contained with all necessary patterns including security
# • COMBINATION GUIDANCE: Use standalone - no need to combine with other templates
# • SECURITY CONSIDERATIONS: Includes security patterns for .env files and credentials
# • BEST PRACTICES: Review before use, test with your specific Django setup
# • OFFICIAL SOURCES: Django community patterns and best practices

# ••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••
# SECURITY & SENSITIVE DATA PROTECTION (ALWAYS FIRST!)
# ••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••
# CRITICAL: Prevent sensitive data from being included in Docker images

# ••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••
# ENVIRONMENT VARIABLES & CONFIGURATION FILES
# ••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••
# Environment files contain sensitive API keys, database credentials,
# and other secrets that must not be included in Docker images

.env
.env.*
.env.*.local
.env.development
.env.development.local
.env.example
.env.local
.env.production
.env.production.local
.env.sample
.env.staging
.env.staging.local
.env.template
.env.test
.env.test.local

# ••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••
# APPLICATION SECRETS & CREDENTIALS
# ••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••

**/config/credentials.*
**/config/secrets.*
**/keys/
**/passwords/
**/private/
**/secrets/
*.accdb
*.auth
*.authz
*.bak
*.db
*.db-journal
*.dump
*.frm
*.ibd
*.mdb
*.myd
*.myi
*.password
*.secret
*.secrets
*.sql
*.sql.bz2
*.sql.gz
*.sql.xz
*.sqlite
*.token
*_tokens
*password*
apikeys.*
appsettings.Development.json
appsettings.Local.json
appsettings.Staging.json
connectionstrings.config
credentials
database.ini
database.yml
db.sqlite3
db.sqlite3-journal
dbconfig.xml
local_settings.py
secret_key.txt
secrets.json
secrets.yaml
secrets.yml
tokens.*

# ••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••
# DEPENDENCY MANAGEMENT & PACKAGE CACHE
# ••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••
# Python dependency management and virtual environments
**/.eggs/
**/.hatch/
**/.mypy_cache/
**/.nox/
**/.pdm-build/
**/.profile_default/
**/.pybuilder/
**/.pyenv/
**/.pypackages/
**/.pyre/
**/.pytest_cache/
**/.pytype/
**/.ruff_cache/
**/.tox/
**/.uv/
**/.venv/
**/__pycache__/
**/__pypackages__/
**/develop-eggs/
**/downloads/
**/eggs/
**/env.bak/
**/ENV/
**/env/
**/lib/
**/lib64/
**/parts/
**/share/python-wheels/
**/venv.bak/
**/venv/
**/virtualenv/
**/wheels/
*.egg
*.egg-info/
.dmypy.json
.installed.cfg
.ipynb_checkpoints
.nosetests.xml
.pdm.toml
.Python
.python-version
.scrapy
.webassets-cache
celerybeat-schedule
celerybeat.pid
MANIFEST
pip-delete-this-directory.txt
pip-log.txt

# ••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••
# BUILD ARTIFACTS & DISTRIBUTION PACKAGES
# ••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••
# Compiled code, build outputs, and distribution packages
**/.nyc_output/
**/.out/
**/.output/
**/build/
**/dist/
**/sdist/
*.manifest
*.mo
*.pot
*.py,cover
*.py[cod]
*.sage.py
*.spec

# ••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••
# DEVELOPMENT & RUNTIME ARTIFACTS
# ••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••
# Development tools cache, runtime data, and temporary files
**/.cache/
**/.django_cache/
**/.hypothesis/
**/.instance/
**/.nose/
**/.vite-cache/
**/.vite/
**/temp/
**/tmp/
*.cache
*.temp
*.tmp

# ••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••
# TESTING & QUALITY ASSURANCE ARTIFACTS
# ••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••
# Test outputs, coverage reports, and quality tool artifacts
**/.cover/
**/cover/
**/coverage/
**/cython_debug/
**/test-results/
.coverage
.coverage.*
coverage.xml

# ••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••
# LOGS & DEBUG FILES
# ••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••
# Application and system logs
**/logs/
*.log

# ••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••
# FRAMEWORK-SPECIFIC PATTERNS
# ••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••
# Django-specific patterns and development artifacts
!*/migrations/__init__.py
*$py.class
**/.bzr/
**/.cvs/
**/.git/
**/.hg/
**/.svn/
**/media/
**/static/
**/staticfiles/
**/var/
*.old
*.orig
*.save
*.swo
*.swp
*/migrations/*.py
*~
._*
.DS_Store
.DS_Store?
.gitattributes
.gitignore
.gitmodules
.Spotlight-V100
.Trashes
desktop.ini
ehthumbs.db
Thumbs.db

Note: This file is fetched from GitHub and cached for 7 days.