https://kotlinlang.org logo
#http4k
Title
# http4k
d

dave

06/25/2019, 4:48 AM
And you still also have to do things like bind the drive mapping in the docker file, and agree on a standard place to read the properties from. ... It's probably more trouble than its worth to do it with the props file tbh
r

Razi Kheir

06/25/2019, 5:50 AM
I’m afraid I lost you a bit, yes I followed the cloud native 12 step and I read from a prop file as one option with other overrides as is written in sample. I have not really worked much with docker, so I dont understand how to read/expose the environment variables in that environment
d

dave

06/25/2019, 5:54 AM
The basis of 12 factor says that all config should be read in from the environment, so the easiest thing is to just use the standard
Environment.ENV
inside the app to read everything from there. You then need to get these variables into your Docker environment, which can be done on the command line when you launch the container - you should read the docker docs for doing that.
👍 1
Docker doesn't know anything about the FS on your host computer (it IS it's own host in most circumstances). So if you want to access the FS from the outside from your Docker container, you need to map (or bind) a host FS drive to a mount inside the container. Using the properties file approach, your app will still need to know where on disk to load the properties from on the drive, which means you'll either need to agree a shared file location
/config/app.properties
, or you can inject the location of that property file....... through an environmental variable!
👍 1
tldr; to isolate your app's running environment from the host's - just use environment variables instead 🙂
r

Razi Kheir

06/26/2019, 3:43 AM
As always thanks for the support, above and beyond