From e374af0bec2ff5991b0106f8f6aba66edbd6d551 Mon Sep 17 00:00:00 2001 From: chandrasegar Date: Thu, 7 Mar 2024 09:09:49 +0530 Subject: [PATCH] docker file added --- Dockerfile | 19 ++++++------------- src/main/resources/application.properties | 6 +++--- 2 files changed, 9 insertions(+), 16 deletions(-) diff --git a/Dockerfile b/Dockerfile index 918deca..371706a 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,15 +1,8 @@ -FROM maven:3.6.3-openjdk-17-slim as BUILDER -ARG VERSION=0.0.1-SNAPSHOT -WORKDIR /build/ -COPY pom.xml /build/ -COPY src /build/src +FROM eclipse-temurin:21-jdk-alpine -RUN mvn clean install -COPY target/mailsender-${VERSION}.jar target/application.jar - -FROM java:21.0.2-jre-slim -WORKDIR /app/ - -COPY --from=BUILDER /build/target/application.jar /app/ -CMD java -jar /app/application.jar +WORKDIR /app +VOLUME /tmp +COPY target/mailsender-0.0.1-SNAPSHOT.jar /app/mailsender-0.0.1-SNAPSHOT.jar +EXPOSE 8080 +ENTRYPOINT ["java", "-jar", "/app/mailsender-0.0.1-SNAPSHOT.jar"] \ No newline at end of file diff --git a/src/main/resources/application.properties b/src/main/resources/application.properties index d6b69fd..c494f5f 100644 --- a/src/main/resources/application.properties +++ b/src/main/resources/application.properties @@ -2,9 +2,9 @@ spring.mail.host=smtp.gmail.com spring.mail.port=587 spring.mail.username=chandrasegar@entgra.io spring.mail.password=kfgt idre luvt ismk -spring.datasource.url=jdbc:mysql://localhost:3306/email_sending -spring.datasource.username=root -spring.datasource.password=StrongPassword123! +spring.datasource.url=jdbc:mysql://192.168.8.103:3306/email_sending +spring.datasource.username=myuser +spring.datasource.password=ComplexP@ssw0rd spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver