Common
Security .dockerignore
.dockerignore for common projects
.dockerignore Content
# ============================================================================
# Created by https://dockerignore.com/
# COMMON PATTERNS TEMPLATE for Security
# Website: https://dockerignore.com/
# Repository: https://github.com/ronald2wing/.dockerignore
# ============================================================================
# ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
# TEMPLATE OVERVIEW & USAGE NOTES
# ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
# • TEMPLATE TYPE: COMMON PATTERNS TEMPLATE
# • PURPOSE: Comprehensive security patterns for all projects
# • DESIGN PHILOSOPHY: Modular security patterns for combination with language templates
# • COMBINATION GUIDANCE: Combine with language templates (ALWAYS include this template)
# • SECURITY CONSIDERATIONS: Critical protection for sensitive data
# • BEST PRACTICES: Place security patterns first in your .dockerignore file
# • OFFICIAL SOURCES: Docker security best practices and community patterns
# IMPORTANT: Framework templates already include security patterns
# ••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••
# SECURITY & SENSITIVE DATA PROTECTION (CRITICAL)
# ••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••
# CRITICAL: Prevent sensitive data from being included in Docker images
# WARNING: These patterns should always be included in production projects
# ••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••
# 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
# ••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••
# CRYPTOGRAPHIC KEYS, CERTIFICATES & TOKENS
# ••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••
# Cryptographic materials, certificates, and tokens that must be protected
*.accdb
*.acl
*.asc
*.auth
*.authz
*.backup
*.bak
*.cer
*.cert
*.confidential
*.cred
*.creds
*.crl
*.crt
*.csr
*.der
*.frm
*.gpg
*.ibd
*.jks
*.key
*.keystore
*.mdb
*.myd
*.myi
*.p12
*.p7b
*.p7c
*.passwd
*.password
*.pem
*.pfx
*.pgp
*.priv
*.private
*.pub
*.pwd
*.req
*.secret
*.secrets
*.sig
*.spc
*.sql
*.sql.bz2
*.sql.gz
*.sql.xz
*.sqlite
*.token
*.truststore
# ••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••
# CLOUD PROVIDER CREDENTIALS & CONFIGURATION
# ••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••
# Cloud provider configuration files and credentials
**/.aws/
**/.aws/config
**/.aws/credentials
**/.azure/
**/.azure/config
**/.azure/credentials
**/.gcloud/
**/.gcloud/config
**/.gcloud/credentials
**/.kube/
**/.kube/config
**/.terraform/
**/.terraform/credentials.tfrc.json
# ••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••
# SSH KEYS, AUTHENTICATION & CONFIGURATION
# ••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••
# SSH keys and authentication configuration
**/.ssh/
authorized_keys
confidential*
config/*.local.*
config/credentials.*
config/local.*
config/secret.*
credential*
credentials.*
credentials.local.*
id_dsa
id_dsa.pub
id_ecdsa
id_ecdsa.pub
id_ed25519
id_ed25519.pub
id_rsa
id_rsa.pub
known_hosts
local-*
local.*
local.config.*
local_*
passwd
password
private*
pwd
secret*
secrets*
secrets.local.*
settings.local.*
ssh_config
ssh_known_hosts
# ••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••
# APPLICATION SECRETS, CREDENTIALS & CONFIGURATION
# ••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••
# Application-specific secrets and credentials
**/config/credentials.*
**/config/secrets.*
**/keys/
**/passwords/
**/private/
**/secrets/
*_tokens
*password*
.config
.config.*
.local
.local.*
.secret
.secret.*
.secrets
.secrets.*
apikeys.*
appsettings.Development.json
appsettings.Local.json
appsettings.Staging.json
connectionstrings.config
credentials
database.ini
database.yml
dbconfig.xml
secrets.json
secrets.yaml
secrets.yml
tokens.*
# ••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••
# DEVELOPMENT & LOCAL CONFIGURATION
# ••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••
# Development and local configuration files that may contain sensitive data
**/config/development.*
**/config/local.*
**/config/staging.*
**/config/test.*
**/settings/development.*
**/settings/local.*
**/settings/staging.*
**/settings/test.*
docker-compose.dev.yml
docker-compose.local.yml
docker-compose.override.yml
docker-compose.test.yml
# ••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••
# DATABASE & DATA STORAGE
# ••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••
# Database files, backups, and data storage that may contain sensitive information
**/backups/
**/data/
**/database/
**/dumps/
**/exports/
*.db
*.db-journal
*.dump