A bad sample file is just a list of KEY= . A great sample file is a work of documentation. Here is the anatomy of a professional .env.sample :
Imagine a new developer joins your team on Monday. Without a .env.sample , they must grep through the codebase looking for process.env.DB_HOST or os.getenv('SECRET_KEY') . With a sample file, they run cp .env.sample .env , fill in the blanks, and run the app in under two minutes. .env.sample
DATABASE_URL=postgresql://admin:Super$3cret@prod-db:5432/sales API_KEY=sk_live_7Fj29kLmNpQrStUvWxYz NODE_ENV=production PORT=8080 they run cp .env.sample .env