# Environment Variables — Docker Fundamentals: Images, Containers and Compose

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

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

```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
```
