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:
commit
fb75531beb
@ -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" />
|
19
backend/.idea/runConfigurations/Run_Compose__PROD_.xml
generated
Normal file
19
backend/.idea/runConfigurations/Run_Compose__PROD_.xml
generated
Normal 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>
|
@ -17,6 +17,9 @@ 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.springframework.boot:spring-boot-starter-actuator'
|
||||||
|
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'
|
||||||
|
5
backend/src/main/resources/application-prod.properties
Normal file
5
backend/src/main/resources/application-prod.properties
Normal 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
|
@ -1,2 +1,4 @@
|
|||||||
server.port=80
|
server.port=80
|
||||||
spring.data.rest.basePath=/api
|
spring.data.rest.basePath=/api
|
||||||
|
spring.datasource.hikari.initialization-fail-timeout=0
|
||||||
|
spring.profiles.active=prod
|
@ -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
|
Loading…
Reference in New Issue
Block a user