Lesson 10 / 28
Environment Variables
Pass configuration to containers with -e and --env-file instead of baking secrets into images.
-e and --env-file
Use -e KEY=value for one-off variables, or --env-file to load many from a file — handy for secrets and per-environment config.
docker run -d -e NODE_ENV=production -e PORT=3000 my-app:1.0
docker run -d --env-file .env my-app:1.0