【docker】docker部署spring boot服务 选择配置文件启动

默认启动命令:

docker run --name swapping -itd --net=host -v /etc/localtime:/etc/localtime:ro  -v /etc/timezone:/etc/timezone:ro  swapping

则 默认启动的配置文件是application.yml或者application.properties文件

 

如果要选择以开发配置文件启动则:

docker run --name swapping -itd --net=host -v /etc/localtime:/etc/localtime:ro  -v /etc/timezone:/etc/timezone:ro  swapping  --spring.profiles.active=pro

加上参数,则启动的配置文件就是application-pro.yml或者application-pro.properties文件。

posted @ 2019-03-06 11:01  Angel挤一挤  阅读(3805)  评论(0编辑  收藏  举报