Docker Compose
Contents
Environment Variables
Environment variables are typically passed into Docker as a way to securely provide authentication, i.e. the root password for MariaDB. It would be antithetical to security to have the variables set within the Docker Compose file. Instead, instruct Docker Compose to pass in a variable that is set already in the local user's environment.
container name: CONTAINER
version: 0.1
services:
web:
image: IMAGE
environment:
- VARIABLE1
- VARIABLE2