This project follows security best practices to prevent credential exposure:
- ❌
.envfiles (already in.gitignore) - ❌
docker-compose.ymlwith real credentials - ❌ Any file containing passwords, API keys, or secrets
- ❌ Hardcoded credentials in source code
- ✅
docker-compose.example.yml(template without real values) - ✅
.env.example(template with placeholder values) - ✅ Configuration files without sensitive data
All sensitive configuration must be set via environment variables:
- Copy
.env.exampleto.env - Replace all placeholder values with secure, unique credentials
- Never commit
.env- it's already in.gitignore
POSTGRES_USER=your_secure_username
POSTGRES_PASSWORD=your_strong_password
POSTGRES_DB=meta_backend
DATABASE_URL="postgresql://username:password@localhost:5432/meta_backend"If you accidentally commit secrets:
- Immediately rotate/revoke the exposed credentials
- Remove from git history using
git filter-branchor BFG Repo-Cleaner - Update all services using those credentials
- Notify your team if working in a team environment
- Review access logs for any unauthorized access
- Use strong passwords (minimum 16 characters)
- Use different credentials for development and production
- Rotate passwords regularly
- Use secrets management tools in production (AWS Secrets Manager, HashiCorp Vault, etc.)
- Enable 2FA on GitHub and other services
- Review
.gitignoreregularly - Use pre-commit hooks to prevent committing secrets
- Never hardcode credentials in
docker-compose.yml - Use environment variables or Docker secrets
- Keep Docker images updated
- Use non-root users in containers (already configured)
- Scan images for vulnerabilities