Skip to content

Commit ea6c623

Browse files
author
Manuel Perez Belmonte
committed
Dockerfile and docker-compose modified, init
1 parent 0559c80 commit ea6c623

File tree

7 files changed

+42
-7
lines changed

7 files changed

+42
-7
lines changed

Dockerfile

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,10 @@
11
FROM openjdk:8-jre-alpine
2-
COPY target/elastest-cost-engine-0.0.1-SNAPSHOT.jar /ece.jar
3-
CMD java -jar /ece.jar
2+
EXPOSE 8888
3+
4+
ADD conf/ece.conf ece.conf
5+
ADD target/elastest-cost-engine-0.0.2-SNAPSHOT.jar ece.jar
6+
ADD run.sh run.sh
7+
8+
RUN chmod +x run.sh
9+
10+
CMD ["/bin/ash", "run.sh"]

conf/ece.conf

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Hibernate connection credentials
2-
HibernateURL=jdbc:postgresql://localhost/ece2
3-
HibernateUsername=ubuntu
4-
HibernatePassword=pass1234
2+
HibernateURL=jdbc:postgresql://postgres/ece
3+
HibernateUsername=elastest
4+
HibernatePassword=elastestpassword
55
HibernateDriver=org.postgresql.Driver
66
HibernateDialect=org.hibernate.dialect.PostgreSQL9Dialect

docker-compose.yml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
version: '3'
2+
3+
services:
4+
postgres:
5+
image: ecepostgres
6+
ports:
7+
- 5432:5432
8+
environment:
9+
- POSTGRES_USER=elastest
10+
- POSTGRES_PASSWORD=elastestpassword
11+
ece:
12+
image: ece
13+
ports:
14+
- 8888:8888

postgres/Dockerfile

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
FROM postgres:9.6.4-alpine
2+
3+
EXPOSE 5432:5432
4+
5+
ADD db_init.sh /docker-entrypoint-initdb.d/init-user-db.sh

postgres/db_init.sh

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
#!/bin/bash
2+
set -e
3+
4+
psql -v ON_ERROR_STOP=1 --username "$POSTGRES_USER" <<-EOSQL
5+
CREATE DATABASE ece;
6+
EOSQL

run.sh

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
sleep 5
2+
3+
java -jar ece.jar ece.conf

src/main/java/io/elastest/ece/application/APIController.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,8 +48,8 @@ public class APIController {
4848

4949
@PostConstruct
5050
public void init() {
51-
// testCostModelValues();
52-
// testTestValues();
51+
testCostModelValues();
52+
testTestValues();
5353
}
5454

5555
@RequestMapping(value = "/", method = RequestMethod.GET)

0 commit comments

Comments
 (0)