Merge branch '14-connect-backend-to-mysql-database' into 'master'

Resolve "Connect Backend to MySQL database"

Closes #14

See merge request marcel.schwarz/2020ss-qbc-geofence-timetracking!17
This commit is contained in:
Marcel Schwarz 2020-04-22 18:54:32 +00:00
commit fb75531beb
7 changed files with 35 additions and 3 deletions

View File

@ -1,7 +1,8 @@
<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" />
<option name="SPRING_BOOT_MAIN_CLASS" value="de.hft.geotime.GeotimeApplication" />
<option name="ACTIVE_PROFILES" value="dev" />
<option name="ALTERNATIVE_JRE_PATH" />
<method v="2">
<option name="Make" enabled="true" />

View File

@ -0,0 +1,19 @@
<component name="ProjectRunConfigurationManager">
<configuration default="false" name="Run Compose [PROD]" type="docker-deploy" factoryName="docker-compose.yml" server-name="Docker">
<deployment type="docker-compose.yml">
<settings>
<option name="removeVolumesOnComposeDown" value="true" />
<option name="commandLineOptions" value="--build" />
<option name="services">
<list>
<option value="backend" />
<option value="db" />
<option value="frontend" />
</list>
</option>
<option name="sourceFilePath" value="../docker-compose.yml" />
</settings>
</deployment>
<method v="2" />
</configuration>
</component>

View File

@ -17,6 +17,9 @@ dependencies {
implementation 'org.springframework.boot:spring-boot-starter-data-rest'
implementation 'org.springframework.boot:spring-boot-starter-web'
implementation 'org.springframework.boot:spring-boot-starter-data-jpa'
implementation 'org.springframework.boot:spring-boot-starter-actuator'
implementation 'org.mariadb.jdbc:mariadb-java-client:1.5.7'
runtimeOnly 'com.h2database:h2'
testImplementation('org.springframework.boot:spring-boot-starter-test') {
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,4 @@
server.port=80
spring.data.rest.basePath=/api
spring.datasource.hikari.initialization-fail-timeout=0
spring.profiles.active=prod

View File

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