From e6743c5928d5998c4d32da10384d6888c30b1741 Mon Sep 17 00:00:00 2001 From: Pelayori <31128562+Pelayori@users.noreply.github.com> Date: Sun, 25 Feb 2024 22:33:04 +0100 Subject: [PATCH] Changes for SSL configuration --- Dockerfile | 2 +- docker-compose.yml | 2 ++ src/main/resources/application-prod.properties | 8 +++++++- 3 files changed, 10 insertions(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index 3fa4a245..752ecea9 100644 --- a/Dockerfile +++ b/Dockerfile @@ -9,5 +9,5 @@ RUN mvn clean package -DskipTests # Run stage with JDK 17 FROM openjdk:17-slim COPY --from=build /app/target/*.jar app.jar -ENTRYPOINT ["java","-Dspring.profiles.active=prod","-jar","/app.jar"] +ENTRYPOINT ["java","-Djava.security.egd=file:/dev/./urandom","-Dspring.profiles.active=prod","-jar","/app.jar"] EXPOSE 443 \ No newline at end of file diff --git a/docker-compose.yml b/docker-compose.yml index 4fe0b954..9a919e47 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -33,6 +33,8 @@ services: - db restart: always + volumes: + - ${KEYSTORE_PATH}:/keystore.p12 volumes: db_data: diff --git a/src/main/resources/application-prod.properties b/src/main/resources/application-prod.properties index 6b392696..8311f261 100644 --- a/src/main/resources/application-prod.properties +++ b/src/main/resources/application-prod.properties @@ -5,4 +5,10 @@ spring.datasource.url=jdbc:mysql://${MYSQL_HOST}:${MYSQL_PORT}/${MYSQL_DATABASE} spring.datasource.username=${MYSQL_USER} spring.datasource.password=${MYSQL_PASSWORD} spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver -spring.jpa.hibernate.ddl-auto=update \ No newline at end of file +spring.jpa.hibernate.ddl-auto=update + +# SSL Configuration +server.ssl.key-store=classpath:keystore.p12 +server.ssl.key-store-password=${KEYSTORE_PASSWORD} +server.ssl.keyStoreType=PKCS12 +server.ssl.keyAlias=keystore \ No newline at end of file