From de75034a09ef2f636109dd8b2be47559e548aee0 Mon Sep 17 00:00:00 2001 From: kbellouard Date: Mon, 7 Jul 2025 11:30:32 +0200 Subject: [PATCH 1/3] fix: env variables --- src/main/resources/application.properties | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/main/resources/application.properties b/src/main/resources/application.properties index 5436e27..13ddc9f 100644 --- a/src/main/resources/application.properties +++ b/src/main/resources/application.properties @@ -1,9 +1,12 @@ # Datasource configuration -spring.datasource.url=jdbc:postgresql://localhost:5432/DbToChange -spring.datasource.username=UserToChange -spring.datasource.password=PwdToChange +spring.datasource.url=${DB_URL:jdbc:postgresql://localhost:5432/sanalyz} +spring.datasource.username=${DB_USER:sanalyz} +spring.datasource.password=${DB_PASSWORD:sanalyz} spring.datasource.driver-class-name=org.postgresql.Driver # Hibernate & JPA settings spring.jpa.hibernate.ddl-auto=update -spring.jpa.show-sql=true \ No newline at end of file +spring.jpa.show-sql=${SHOW_SQL:true} + +ai.api-url=${AI_API_URL:http://localhost:8080/api} +ai.api-key=${AI_API_KEY:abcd1234} From 28f7e25a2632f1f03b44eec1f91dcff7665ee766 Mon Sep 17 00:00:00 2001 From: Th4End Date: Tue, 8 Jul 2025 11:11:42 +0200 Subject: [PATCH 2/3] update --- Dockerfile | 10 ++++++++++ src/main/resources/application.properties | 14 +++++++++----- 2 files changed, 19 insertions(+), 5 deletions(-) create mode 100644 Dockerfile diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..fbb5bd1 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,10 @@ +FROM maven:3.9.6-eclipse-temurin-21 + +WORKDIR /app + +COPY pom.xml . +COPY src ./src + +EXPOSE 8080 + +CMD ["mvn", "spring-boot:run", "-Dspring-boot.run.arguments=--server.address=0.0.0.0"] \ No newline at end of file diff --git a/src/main/resources/application.properties b/src/main/resources/application.properties index 5436e27..41cd31f 100644 --- a/src/main/resources/application.properties +++ b/src/main/resources/application.properties @@ -1,9 +1,13 @@ # Datasource configuration -spring.datasource.url=jdbc:postgresql://localhost:5432/DbToChange -spring.datasource.username=UserToChange -spring.datasource.password=PwdToChange +spring.datasource.url=jdbc:postgresql://db:5432/sanalyz +spring.datasource.username=sanalyz +spring.datasource.password=sanalyz spring.datasource.driver-class-name=org.postgresql.Driver # Hibernate & JPA settings -spring.jpa.hibernate.ddl-auto=update -spring.jpa.show-sql=true \ No newline at end of file +spring.jpa.hibernate.ddl-auto=validate +spring.jpa.show-sql=true +server.address=0.0.0.0 + +ai.api-url=http://ia:8081 +ai.api-key=abcd1234 From f7c2f45fbe5115be081757f99e4cb93076f19f47 Mon Sep 17 00:00:00 2001 From: kbellouard Date: Tue, 8 Jul 2025 11:30:44 +0200 Subject: [PATCH 3/3] feat: ci-cd deployment --- src/main/resources/application.properties | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/main/resources/application.properties b/src/main/resources/application.properties index 41cd31f..135e067 100644 --- a/src/main/resources/application.properties +++ b/src/main/resources/application.properties @@ -1,13 +1,13 @@ # Datasource configuration -spring.datasource.url=jdbc:postgresql://db:5432/sanalyz -spring.datasource.username=sanalyz -spring.datasource.password=sanalyz +spring.datasource.url=${DB_URL:jdbc:postgresql://localhost:5432/sanalyz} +spring.datasource.username=${DB_USER:sanalyz} +spring.datasource.password=${DB_PASSWORD:sanalyz} spring.datasource.driver-class-name=org.postgresql.Driver # Hibernate & JPA settings -spring.jpa.hibernate.ddl-auto=validate -spring.jpa.show-sql=true +spring.jpa.hibernate.ddl-auto=${DDL_AUTO:update} +spring.jpa.show-sql=${SHOW_SQL:true} server.address=0.0.0.0 -ai.api-url=http://ia:8081 -ai.api-key=abcd1234 +ai.api-url=${AI_API_URL:http://localhost:8081} +ai.api-key=${AI_API_KEY:abcd1234}