Add dev and prod profile, Add MariaDB connector

Prod is default
Add IDEA Run Configs for DEV (IDEA) and PROD (Docker-Compose)
This commit is contained in:
Marcel Schwarz 2020-04-21 11:22:03 +02:00
parent 496394dac1
commit 2c7418529b
7 changed files with 14 additions and 4 deletions

View File

@ -1,7 +1,8 @@
<component name="ProjectRunConfigurationManager"> <component name="ProjectRunConfigurationManager">
<configuration default="false" name="GeotimeApplication" type="SpringBootApplicationConfigurationType" factoryName="Spring Boot"> <configuration default="false" name="GeotimeApplication [DEV]" type="SpringBootApplicationConfigurationType" factoryName="Spring Boot">
<module name="geotime.main" /> <module name="geotime.main" />
<option name="SPRING_BOOT_MAIN_CLASS" value="de.hft.geotime.GeotimeApplication" /> <option name="SPRING_BOOT_MAIN_CLASS" value="de.hft.geotime.GeotimeApplication" />
<option name="ACTIVE_PROFILES" value="dev" />
<option name="ALTERNATIVE_JRE_PATH" /> <option name="ALTERNATIVE_JRE_PATH" />
<method v="2"> <method v="2">
<option name="Make" enabled="true" /> <option name="Make" enabled="true" />

View File

@ -1,5 +1,5 @@
<component name="ProjectRunConfigurationManager"> <component name="ProjectRunConfigurationManager">
<configuration default="false" name="Run Compose" type="docker-deploy" factoryName="docker-compose.yml" server-name="Docker"> <configuration default="false" name="Run Compose [PROD]" type="docker-deploy" factoryName="docker-compose.yml" server-name="Docker">
<deployment type="docker-compose.yml"> <deployment type="docker-compose.yml">
<settings> <settings>
<option name="removeVolumesOnComposeDown" value="true" /> <option name="removeVolumesOnComposeDown" value="true" />

View File

@ -17,6 +17,7 @@ dependencies {
implementation 'org.springframework.boot:spring-boot-starter-data-rest' implementation 'org.springframework.boot:spring-boot-starter-data-rest'
implementation 'org.springframework.boot:spring-boot-starter-web' implementation 'org.springframework.boot:spring-boot-starter-web'
implementation 'org.springframework.boot:spring-boot-starter-data-jpa' implementation 'org.springframework.boot:spring-boot-starter-data-jpa'
implementation 'org.mariadb.jdbc:mariadb-java-client:1.5.7'
runtimeOnly 'com.h2database:h2' runtimeOnly 'com.h2database:h2'
testImplementation('org.springframework.boot:spring-boot-starter-test') { testImplementation('org.springframework.boot:spring-boot-starter-test') {
exclude group: 'org.junit.vintage', module: 'junit-vintage-engine' exclude group: 'org.junit.vintage', module: 'junit-vintage-engine'

View File

@ -0,0 +1,5 @@
spring.jpa.hibernate.ddl-auto=update
spring.datasource.url=jdbc:mariadb://db:3306/geotime
spring.datasource.username=root
spring.datasource.password=supersecure
spring.datasource.driver-class-name=org.mariadb.jdbc.Driver

View File

@ -1,2 +1,3 @@
server.port=80 server.port=80
spring.data.rest.basePath=/api spring.data.rest.basePath=/api
spring.profiles.active=prod

View File

@ -21,9 +21,11 @@ services:
db: db:
container_name: qbc_database container_name: qbc_database
restart: always
build: build:
context: ./sql context: ./sql
volumes: volumes:
- "./sql/db-data:/var/lib/mysql" - "./sql/db-data:/var/lib/mysql"
environment: environment:
MYSQL_ROOT_PASSWORD: "ubc-timetracking" MYSQL_DATABASE: geotime
MYSQL_ROOT_PASSWORD: supersecure