diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000000000000000000000000000000000000..97bc4e2c1802e929c48b530c5ad2288a271762b0 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,4 @@ +FROM openjdk:8-jre-alpine +COPY target/restmembox-0.2-SNAPSHOT.jar /opt/memorybox/app.jar +ENTRYPOINT ["java", "-Djava.security.egd=file:/dev/./urandom", "-Dspring.profiles.active=docker", "-jar", "/opt/memorybox/app.jar"] +EXPOSE 8080 \ No newline at end of file diff --git a/pom.xml b/pom.xml index 479242453a952f567ceb42aa2d11a0b09c2bbb21..580257a77e42e43f3a8f85d68113a67ba1a4dddf 100644 --- a/pom.xml +++ b/pom.xml @@ -25,6 +25,8 @@ </properties> <dependencies> + + <!-- Spring Boot --> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-data-rest</artifactId> @@ -42,16 +44,25 @@ <artifactId>spring-boot-starter-web</artifactId> </dependency> + <!-- DataSources --> <dependency> <groupId>mysql</groupId> <artifactId>mysql-connector-java</artifactId> <scope>runtime</scope> </dependency> + <dependency> + <groupId>org.hsqldb</groupId> + <artifactId>hsqldb</artifactId> + <scope>test</scope> + </dependency> + <dependency> <groupId>org.projectlombok</groupId> <artifactId>lombok</artifactId> <optional>true</optional> </dependency> + + <!-- Test --> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-test</artifactId> diff --git a/src/main/resources/application-development.properties b/src/main/resources/application-development.properties new file mode 100644 index 0000000000000000000000000000000000000000..8589cfa54b1b11a34991ca80911faa470300e7fc --- /dev/null +++ b/src/main/resources/application-development.properties @@ -0,0 +1,6 @@ +spring.datasource.url=jdbc:mysql://localhost:3306/memorybox?useUnicode=yes&characterEncoding=UTF-8 +spring.datasource.username=memory +spring.datasource.password=memory + +spring.jpa.hibernate.ddl-auto=create + diff --git a/src/main/resources/application-docker.properties b/src/main/resources/application-docker.properties new file mode 100644 index 0000000000000000000000000000000000000000..4f4aeb59dcb95e8cb776e7df92303a15e5015117 --- /dev/null +++ b/src/main/resources/application-docker.properties @@ -0,0 +1,6 @@ +spring.datasource.url=jdbc:mysql://mariadb_memorybox:3306/memorybox?useUnicode=yes&characterEncoding=UTF-8 +spring.datasource.username=memory +spring.datasource.password=memory + +spring.jpa.hibernate.ddl-auto=create + diff --git a/src/main/resources/application.properties b/src/main/resources/application.properties index 8589cfa54b1b11a34991ca80911faa470300e7fc..88cfe11235dc3870366e55681c35b4def8f44956 100644 --- a/src/main/resources/application.properties +++ b/src/main/resources/application.properties @@ -1,6 +1,7 @@ -spring.datasource.url=jdbc:mysql://localhost:3306/memorybox?useUnicode=yes&characterEncoding=UTF-8 -spring.datasource.username=memory -spring.datasource.password=memory +#spring.datasource.driver-class-name= +#spring.datasource.url=jdbc:h2:mem:db;DB_CLOSE_DELAY=-1\ +#spring.datasource.username=memory +#spring.datasource.password=memory spring.jpa.hibernate.ddl-auto=create