Optimize profiles path in docker
This commit is contained in:
@@ -10,4 +10,4 @@ COPY ${EXTRACTED}/snapshot-dependencies/ /
|
||||
RUN true
|
||||
COPY ${EXTRACTED}/application/ /
|
||||
|
||||
ENTRYPOINT ["java", "org.springframework.boot.loader.JarLauncher", "${JAVA_OPTS}"]
|
||||
ENTRYPOINT ["java", "org.springframework.boot.loader.JarLauncher", "--spring.config.additional-location=file:data/", "${JAVA_OPTS}"]
|
||||
@@ -21,10 +21,10 @@ fun main(args: Array<String>) {
|
||||
}
|
||||
}
|
||||
|
||||
if (File("application-config.yml").exists()) {
|
||||
if (File("application-config.yml").exists() || File("data/application-config.yml").exists()) {
|
||||
runApplication<FatWebApiApplication>(*args)
|
||||
} else {
|
||||
logger.warn("File ‘application.yml’ cannot be found in the running path. The configuration file template 'application.example.yml' has been created in directory 'data'. Please change the configuration file content, rename it to 'application.yml' and put it in the running path, and then restart the server.")
|
||||
logger.warn("File ‘application.yml’ cannot be found in the running path. The configuration file template 'application.example.yml' has been created in directory 'data'. Please change the configuration file content, rename it to 'application.yml', and then restart the server.")
|
||||
FatWebApiApplication::class.java.getResource("/application-config-template.yml")?.readText()?.let {
|
||||
File("data/application-config.example.yml").writeText(
|
||||
it.replace(
|
||||
|
||||
Reference in New Issue
Block a user