# Environment Variables — Docker

Source: https://www.geekswithgeeks.com/en/docker/docker-env-vars

> Pass configuration into a container without baking it into the image.

## -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.

```bash
docker run -d -e NODE_ENV=production -e PORT=3000 my-app:1.0
docker run -d --env-file .env my-app:1.0
```
