Docker implementation

This commit is contained in:
2020-08-29 21:42:36 +02:00
parent 504df2b15d
commit 7736f9abfc
5 changed files with 32 additions and 1 deletions

5
Dockerfile Normal file
View File

@@ -0,0 +1,5 @@
FROM bellsoft/liberica-openjdk-alpine
EXPOSE 8889
RUN mkdir -p /app/
ADD build/libs/webquizengine.jar /app/webquizengine.jar
ENTRYPOINT ["java", "-jar", "/app/webquizengine.jar"]

View File

@@ -1,5 +1,7 @@
# WebQuizEngine
Spring Boot web service to create and solve quizzes using a REST API.
Spring Boot web service to create and solve quizzes via REST API using Docker as deployment tool.
![](src/main/resources/banner.png)
## Register user
To register a new user send a JSON with `email` and `password` via `POST` request to `/api/register`:
``` json

View File

@@ -7,6 +7,15 @@ apply plugin: 'io.spring.dependency-management'
sourceCompatibility = '11'
task fullJar(type: Jar) {
manifest {
attributes 'Implementation-Title': 'WebQuizEngine Jar File',
'Main-Class': 'org.hyperskill.webquiz.engine.WebQuizEngine'
}
from { configurations.compile.collect { it.isDirectory() ? it : zipTree(it) } }
with jar
}
repositories {
mavenCentral()
}

15
docker-compose.yml Normal file
View File

@@ -0,0 +1,15 @@
# Docker Compose file Reference (https://docs.docker.com/compose/compose-file/)
version: '3.8'
# Define services
services:
# Engine service
engine:
# Configuration for building the docker image for the engine service
build:
context: ./ # Use an image built from the specified dockerfile in the root directory.
dockerfile: Dockerfile
ports:
- "8889:8889" # Forward the exposed port 8889 on the container to port 8889 on the host machine
restart: always

Binary file not shown.

After

Width:  |  Height:  |  Size: 33 KiB