Reading docker-compose environment variables in application code -


maybe i'm being really dumb , not understanding properly; want define docker-compose.yml file so:

web:   ...   environment:     foo: bar     bar: foo 

and want expose environment variables runtime applications run inside container (i guess mapping them shell variables?).

what's best way achieve this?

i think have minor syntax issue in yml, try changing to:

web:   ...   environment:     - foo=bar     - bar=foo 

you should able access variables in code expected.


Comments

Popular posts from this blog

html - Outlook 2010 Anchor (url/address/link) -

javascript - Why does running this loop 9 times take 100x longer than running it 8 times? -

Getting gateway time-out Rails app with Nginx + Puma running on Digital Ocean -