From f49404b9ec59ec431cb6fc6f616804d7493919c0 Mon Sep 17 00:00:00 2001 From: Leandro Pinho Date: Thu, 13 Feb 2020 16:17:29 -0300 Subject: [PATCH] Dockerfile --- Dockerfile | 6 ++++++ pom.xml | 22 +++++++++++++++++++++- src/main/resources/application.properties | 9 +++++---- 3 files changed, 32 insertions(+), 5 deletions(-) create mode 100644 Dockerfile diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..e973471 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,6 @@ +FROM openjdk:8-jdk-alpine +VOLUME /tmp +EXPOSE 8091 +ADD target/*.jar app.jar +ENV JAVA_OPTS="" +ENTRYPOINT [ "sh", "-c", "java $JAVA_OPTS -Djava.security.egd=file:/dev/./urandom -jar /app.jar" ] \ No newline at end of file diff --git a/pom.xml b/pom.xml index ffadbcd..d21ba64 100644 --- a/pom.xml +++ b/pom.xml @@ -70,6 +70,7 @@ + beacon-input org.springframework.boot @@ -78,7 +79,26 @@ true + + + com.spotify + dockerfile-maven-plugin + 1.4.10 + + + default + + build + + + + + + lpcorrea/${project.name} + ${project.version} + true + + - diff --git a/src/main/resources/application.properties b/src/main/resources/application.properties index e0801d8..d3f9e58 100644 --- a/src/main/resources/application.properties +++ b/src/main/resources/application.properties @@ -8,9 +8,10 @@ info.app.description=Input data info.app.version=1.0.0.0-rc1 #Database -spring.datasource.url=jdbc:mysql://localhost/beacon-input?useSSL=false&useTimezone=false&serverTimezone=UTC -spring.datasource.username=root -spring.datasource.password=123456 +spring.datasource.url=jdbc:mysql://${RDS_HOSTNAME:localhost}:${RDS_PORT:3306}/${RDS_DB_NAME:beacon_input}?useSSL=false&useTimezone=false&serverTimezone=UTC +spring.datasource.username=${RDS_USERNAME:root} +spring.datasource.password=${RDS_PASSWORD:123456} + spring.jpa.hibernate.ddl-auto=validate #hibernate @@ -26,7 +27,7 @@ logging.level.root=warn spring.jpa.open-in-view=false #queue -spring.rabbitmq.host=localhost +spring.rabbitmq.host=${BEACON_RABBIT_HOSTNAME:localhost} spring.rabbitmq.port=5672 spring.rabbitmq.username=guest spring.rabbitmq.password=guest