Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dockerize OneMock server component #2

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions Server/src/main/docker/Dockerfile
Original file line number Diff line number Diff line change
@@ -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"\
]
18 changes: 18 additions & 0 deletions Server/src/main/docker/README.md
Original file line number Diff line number Diff line change
@@ -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``