.env.sample -

# ===========================================
# APPLICATION SETTINGS
# ===========================================
# Environment mode. Options: 'dev', 'staging', 'prod'
# Affects logging verbosity and error reporting.
APP_ENV=dev
# Port to expose the API. Defaults to 8080.
PORT=8080
# ===========================================
# DATABASE CONFIGURATION
# ===========================================
# Hostname of the Postgres instance.
DB_HOST=localhost
# Port for the database. Default Postgres port is 5432.
DB_PORT=5432
# Database name.
DB_NAME=my_app_db
# Credentials. Ensure these match your local docker-compose or DB setup.
DB_USER=admin
DB_PASSWORD=password
# ===========================================
# EXTERNAL SERVICES
# ===========================================
# [REQUIRED] Stripe Secret Key. Use test keys for local dev.
# Get yours at: https://dashboard.stripe.com/test/apikeys
STRIPE_SECRET_KEY=sk_test_51xyz...

DATABASE_URL=postgresql://user:pass@localhost:5432/mydb DATABASE_POOL_SIZE=20

awk -F= '!/^#/ && NF==2 print $1"=" /^#/ print ' .env > .env.sample .env.sample

But better: maintain .env.sample manually as the source of truth. awk -F= '