diff --git a/Server/src/main/docker/Dockerfile b/Server/src/main/docker/Dockerfile new file mode 100644 index 0000000..cd99881 --- /dev/null +++ b/Server/src/main/docker/Dockerfile @@ -0,0 +1,13 @@ +FROM openjdk:11-slim + +WORKDIR /apps + +COPY target/*.jar /apps/onemock-v1.1.jar + +EXPOSE 8080 + +ENTRYPOINT [ \ + "java",\ + "-jar",\ + "/apps/onemock-v1.1.jar"\ +] \ No newline at end of file diff --git a/Server/src/main/docker/README.md b/Server/src/main/docker/README.md new file mode 100644 index 0000000..adb7bc1 --- /dev/null +++ b/Server/src/main/docker/README.md @@ -0,0 +1,18 @@ +### To utilize docker functionality for the onemock server, Please follow instructions mentioned below + +#### 1. Change the directory to `./Server` + +#### 2. Execute following command to generate Jar + +``mvn clean package -DskipTests`` + +It will gererate the jar and place it in the `../target` directory +#### 3. Next, execute following command to create an docker image for onemock server + +``docker image build -t onemock . -f src/main/docker/Dockerfile`` + +#### 4. Finally, start docker container with + +``docker run --name onemock -p 8080:8080 onemock:latest`` + +and in browser, open ``http://localhost:8080`` \ No newline at end of file