docker-compose

Environment variables external file

Introduction#

There a number of ways to include environment variables into the docker application. Here are some examples:

Via External File

docker-composer.yml

  web:
    ...
    env_file:
     - ./filename

filename

variable=value

within the docker-compose itself

app:
  ...
  environment:
    - var=value

This modified text is an extract of the original Stack Overflow Documentation created by the contributors and released under CC BY-SA 3.0 This website is not affiliated with Stack Overflow