dockerfile文件
FROM openjdk:8-jdk-alpine ADD *.jar app.jar ENTRYPOINT ["java","-Djava.security.egd=file:/dev/./urandom","-Dspring.profiles.active=${SPRING_PROFILES_ACTIVE}","-jar","/app.jar"]
idea docker配置
关键部分,在启动命令中加入
-e SPRING_PROFILES_ACTIVE="prod"