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

java - WARN : org.springframework.web.servlet.PageNotFound - No mapping found for HTTP request with URI [/board/] in DispatcherServlet with name 'appServlet' -

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

android - How to create dynamically Fragment pager adapter -