cloudstore-developers

added database

4/3/2019 5:34:30 PM

Details

docker-compose.yml 25(+24 -1)

diff --git a/docker-compose.yml b/docker-compose.yml
index ce8bcc7..049c15d 100644
--- a/docker-compose.yml
+++ b/docker-compose.yml
@@ -3,6 +3,10 @@ services:
   application:
     build: .
     container_name: cloudstore
+    depends_on:
+      - "database"
+    links:
+      - database
     volumes:
       - application:/application
       - /root/.m2:/root/.m2
@@ -13,5 +17,24 @@ services:
       options:
         max-size: "10m"
         max-file: "10"
+
+  database:
+    image: mysql:5.7.22
+    expose:
+      - 3306
+    volumes:
+      - ../../dumps/cloudstore.sql:/docker-entrypoint-initdb.d/init.sql
+      - database:/var/lib/mysql
+    environment:
+      MYSQL_USER: root
+      MYSQL_ROOT_PASSWORD: root
+      MYSQL_DATABASE: tpcw
+    restart: unless-stopped
+    logging:
+      options:
+        max-size: "10m"
+        max-file: "10"
+
 volumes:
-  application:
\ No newline at end of file
+  application:
+  database:
\ No newline at end of file

pom.xml 21(+20 -1)

diff --git a/pom.xml b/pom.xml
index b38ed67..dca7e41 100644
--- a/pom.xml
+++ b/pom.xml
@@ -15,7 +15,7 @@
 		</repository>
 	</repositories>
 	<properties>
-		<org.springframework.version>3.2.1.RELEASE</org.springframework.version>
+		<org.springframework.version>4.3.5.RELEASE</org.springframework.version>
 		<log4j.version>1.2.17</log4j.version>
 	</properties>
 	<dependencies>
@@ -57,6 +57,12 @@
 			<version>1.2</version>
 		</dependency>
 
+<dependency>
+    <groupId>org.springframework</groupId>
+    <artifactId>spring-expression</artifactId>
+    <version>4.2.5.RELEASE</version>
+</dependency>
+
 		<dependency>
 			<groupId>org.springframework.data</groupId>
 			<artifactId>spring-data-mongodb</artifactId>
@@ -191,6 +197,19 @@
 					<encoding>UTF-8</encoding>
 				</configuration>
 			</plugin>
+
+            <plugin>
+                <groupId>org.apache.tomcat.maven</groupId>
+                <artifactId>tomcat7-maven-plugin</artifactId>
+                <version>2.2</version>
+                <configuration>
+                    <server>tomcat-development-server</server>
+                    <systemProperties>
+                        <JAVA_OPTS>-Xms1024m -Xmx2048m</JAVA_OPTS>
+                    </systemProperties>
+                </configuration>
+            </plugin>
+
 			<!-- <plugin> -->
 			<!-- <groupId>org.codehaus.cargo</groupId> -->
 			<!-- <artifactId>cargo-maven2-plugin</artifactId> -->
diff --git a/src/main/resources/app-context.xml b/src/main/resources/app-context.xml
index 0c5cafc..9e23ef9 100755
--- a/src/main/resources/app-context.xml
+++ b/src/main/resources/app-context.xml
@@ -11,7 +11,7 @@
 			http://www.springframework.org/schema/task/spring-task-3.0.xsd">
 	
    	<import resource="classpath:cache.xml" />
-	<import resource="classpath:${eu.cloudscale.datasource}.xml" />
+	<import resource="classpath:hibernate.xml" />
 	<import resource="classpath:servlet-context.xml" />
 	
     <context:annotation-config /> 
diff --git a/src/main/resources/database/database.hibernate.properties b/src/main/resources/database/database.hibernate.properties
index be4c16a..b32855f 100755
--- a/src/main/resources/database/database.hibernate.properties
+++ b/src/main/resources/database/database.hibernate.properties
@@ -1,7 +1,7 @@
 jdbc.dbtype=mysql
 jdbc.driverClassName=com.mysql.jdbc.Driver
-jdbc.url=jdbc:mysql://localhost/tpcw?autoReconnect=true
+jdbc.url=jdbc:mysql://database:3306/tpcw?autoReconnect=true
 jdbc.username=root
-jdbc.password=toor
+jdbc.password=root
 jdbc.pool_size=150
 jdbc.hibernate.dialect=org.hibernate.dialect.MySQLDialect