How to set Spring profile from system variable?

前端 未结 7 1545
无人共我
无人共我 2020-12-07 18:12

I have a Spring project which uses another project. Each project has its own spring profile initialize from java code using applicationContext.xml and *.p

7条回答
  •  温柔的废话
    2020-12-07 19:05

    If you are using docker to deploy the spring boot app, you can set the profile using the flag e:

    docker run -e "SPRING_PROFILES_ACTIVE=prod" -p 8080:8080 -t r.test.co/myapp:latest

提交回复
热议问题