I want to have several yaml files for DropWizard. One of them contain sensitive info and one non sensitive.
Can you point me to any docs or example how to have multiple
Ideally you should be configuring your app by putting your sensitive information or configurable data inside Environment Variables, rather than managing multiple files. See twelve factor rule on config: http://12factor.net/config
To enable this approach in Dropwizard, you can either override your config with Environment Variables at run time using the -Ddw
flag:
java -Ddw.http.port=$PORT -jar yourapp.jar server yourconfig.yml
or you can use this handy add on: https://github.com/tkrille/dropwizard-template-config to put Environment Variable placeholders inside your config:
server:
type: simple
connector:
type: http
# replacing environment variables
port: ${env.PORT}
Both of the above solutions are compatible with Heroku and Docker containers, where the Environment Variable are only available when you run the app.