This is the codeAbility Sharing Platform! Learn more about the codeAbility Sharing Platform.

Skip to content
Snippets Groups Projects
Commit 6c2c2e6b authored by Michael Breu's avatar Michael Breu
Browse files

More information on db-URL

parent f17953a0
2 merge requests!188Merging Peer Reviewing et. al to Master,!164211 peer reviewing functionality
......@@ -3,6 +3,7 @@ services:
gitsearch-app:
image: gitsearch:latest
container_name: sharing_search
hostname: sharing_search
environment:
- _JAVA_OPTIONS=-Xmx512m -Xms256m
- SPRING_PROFILES_ACTIVE=${SPRING_PROFILES_ACTIVE}
......@@ -36,6 +37,7 @@ services:
sharing_mysql:
image: mysql:8.0.20
container_name: sharing_mysql
hostname: sharing_mysql
volumes:
- '$MYSQL_HOME:/var/lib/mysql/'
environment:
......
package at.ac.uibk.gitsearch.config;
import java.sql.SQLException;
import javax.annotation.PostConstruct;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Profile;
......@@ -24,10 +28,18 @@ public class DatabaseConfiguration {
private final Logger log = LoggerFactory.getLogger(DatabaseConfiguration.class);
private final Environment env;
@Value("${spring.datasource.url}")
private String databseConnectionString;
public DatabaseConfiguration(Environment env) {
this.env = env;
}
@PostConstruct
public void logDBUrl() {
log.info("Using db connection string {}", databseConnectionString);
}
/**
* Open the TCP port for the H2 database, so it is available remotely.
......
......@@ -45,7 +45,7 @@ spring:
indent-output: true
datasource:
type: com.zaxxer.hikari.HikariDataSource
url: jdbc:mysql://localhost:3306/gitsearch?useUnicode=true&characterEncoding=utf8&useSSL=false&useLegacyDatetimeCode=false&serverTimezone=UTC&createDatabaseIfNotExist=true
url: jdbc:mysql://sharing_mysql:3306/gitsearch?useUnicode=true&characterEncoding=utf8&useSSL=false&useLegacyDatetimeCode=false&serverTimezone=UTC&createDatabaseIfNotExist=true
username: root
password:
hikari:
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment