Specify the env file docker compose uses -


is possible specify env file docker compose uses variable substitution? defaults ".env" have different flavours of compose files should have different envs.

you can use inheritance this. if have 1 "base" service set environment, of other services can inherit that.

example:

version: "2"  services:   base:     env_file:       - my_env.txt    web:     extends:       service: base     image: foo    database:     extends:       service: base     image: foo-db 

the above example has in same file, can split multiple files, base service reside in base.yaml file. need add file: base.yaml extends section. please see the documentation here.

i use approach setting proxy variables containers. have proxy.yaml file defines proxy-app service picks proxy environment variables shell. of real services extend proxy-app service , inherit environment settings service.


Comments

Popular posts from this blog

aws api gateway - SerializationException in posting new Records via Dynamodb Proxy Service in API -

asp.net - Problems sending emails from forum -