I use the sbt native packager plugin to create my application's zip file for deployment on an elastic beanstalk. I would like to set environment variables in my beanstalk environment and use them to configure my application at runtime. I tried referencing env variables in my Procfile as follows:
web: ./bin/bridgeservice -Dhttp.port=$PORT
This does not work, because it is $PORTnot interpolated by the start script generated by the packer.
I also tried to define the variables in my build.sbt file as follows:
import scala.util.Properties
javaOptions in Universal ++= Seq(
"-Dhttp.port=" + Properties.envOrElse("PORT", "9004"),
)
This also does not work, because the packer expects an PORTenv variable during creation of distributed zip and hardcodes with the default value of 9004 in the application.ini file.
java ?