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 73317f0..dc47780 100644 --- a/src/main/resources/application.properties +++ b/src/main/resources/application.properties @@ -1,7 +1,7 @@ # Datasource configuration -spring.datasource.url=jdbc:postgresql://localhost: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 server.port=8080 @@ -12,8 +12,9 @@ server.servlet.session.cookie.http-only=true security.ignored=/** # Hibernate & JPA settings -spring.jpa.hibernate.ddl-auto=update -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://localhost:8081 -ai.api-key=abcd1234 +ai.api-url=${AI_API_URL:http://localhost:8081} +ai.api-key=${AI_API_KEY:abcd1234} \ No newline at end of file