From 2634256f0206203582ab2176510a206da8d30232 Mon Sep 17 00:00:00 2001 From: Marcel Schwarz Date: Fri, 12 Jun 2020 03:29:47 +0200 Subject: [PATCH] Switch to postgres database in backend --- backend/build.gradle | 1 + backend/src/main/resources/application-prod.properties | 4 ++-- docker-compose.yml | 9 +++++---- sql/Dockerfile | 2 +- 4 files changed, 9 insertions(+), 7 deletions(-) diff --git a/backend/build.gradle b/backend/build.gradle index 2d135e8..8fe7ad2 100644 --- a/backend/build.gradle +++ b/backend/build.gradle @@ -22,6 +22,7 @@ dependencies { compileOnly 'org.projectlombok:lombok' annotationProcessor 'org.projectlombok:lombok' implementation 'org.mariadb.jdbc:mariadb-java-client' + implementation 'org.postgresql:postgresql' implementation "org.springframework.boot:spring-boot-starter-security" implementation "com.auth0:java-jwt:3.10.2" diff --git a/backend/src/main/resources/application-prod.properties b/backend/src/main/resources/application-prod.properties index 63f56f2..76036cd 100644 --- a/backend/src/main/resources/application-prod.properties +++ b/backend/src/main/resources/application-prod.properties @@ -1,5 +1,5 @@ spring.jpa.hibernate.ddl-auto=update -spring.datasource.url=jdbc:mariadb://db:3306/geotime +spring.datasource.url=jdbc:postgresql://db:5432/geotime spring.datasource.username=root spring.datasource.password=supersecure -spring.datasource.driver-class-name=org.mariadb.jdbc.Driver \ No newline at end of file +spring.datasource.driver-class-name=org.postgresql.Driver \ No newline at end of file diff --git a/docker-compose.yml b/docker-compose.yml index e5daad0..732023b 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -26,10 +26,11 @@ services: build: context: ./sql volumes: - - "qbc-db-data:/var/lib/mysql" + - "db-data:/var/lib/postgresql/data" environment: - MYSQL_DATABASE: geotime - MYSQL_ROOT_PASSWORD: supersecure + POSTGRES_DB: geotime + POSTGRES_PASSWORD: supersecure + POSTGRES_USER: root volumes: - qbc-db-data: \ No newline at end of file + db-data: \ No newline at end of file diff --git a/sql/Dockerfile b/sql/Dockerfile index 166b0ac..1770298 100644 --- a/sql/Dockerfile +++ b/sql/Dockerfile @@ -1,2 +1,2 @@ -FROM mariadb +FROM postgres ENV TZ=Europe/Berlin \ No newline at end of file