If I was running my application sans Docker, I would do something like this:
./myapp -Dconfig.file=conf/application.prod.conf -Dlogger.resource=logback.prod.xml
In fact, I can do even better and put them into by build.sbt
file:
// Production Mode
javaOptions in Production ++= Seq(
"-Dconfig.file=conf/application.prod.conf",
"-Dlogger.resource=logback.prod.xml"
)
and then they will be applied when I run my app:
./myapp # options now applied via build.sbt
When I build my app with sbt docker:publishLocal
, then run it with docker run, the javaOptions
do not take effect.
How can I get these javaOptions
to take effect when I docker run
?