Skip to content

Commit 34ca39e

Browse files
authored
Added Dockerfile for build docker image based on local source code ch… (#133)
1 parent 651bd9b commit 34ca39e

File tree

4 files changed

+88
-0
lines changed

4 files changed

+88
-0
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,3 +48,4 @@ Visit [Eiffel Community](https://eiffel-community.github.io) to get started and
4848
1. [**Test Rules User Guide**](./wiki/markdown/Test-Rules.md)
4949
1. [**Front-end With CURL**](./wiki/markdown/Front-end_with_curl.md)
5050
- [**Examples, using CURL through EI Front-End**](./wiki/markdown/Front-end_with_curl.md#Curl-Examples)
51+
1. [**Docker**](./wiki/markdown/docker.md)

src/main/docker/Dockerfile

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
FROM fabric8/java-jboss-openjdk8-jdk:1.2
2+
MAINTAINER Eiffel-Community
3+
USER root
4+
ENV JAVA_APP_DIR=/deployments
5+
ENV JAVA_APP_JAR=eiffel-intelligence-frontend.war
6+
EXPOSE 8092 8778 9779
7+
8+
# Create image with existing war file. User need to execute 'mvn package -DskipTest' before 'docker build'
9+
COPY ./target/eiffel-intelligence-frontend-*.war /deployments/eiffel-intelligence-frontend.war
10+
11+
CMD /deployments/run-java.sh
12+
13+

wiki/markdown/docker.md

Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
# Docker
2+
3+
In Eiffel-Intelligence frontend source code a Dockerfile is provided which helps the developer or user to build the local Eiffel-Intellegence frontend source code repository changes to a Docker image.
4+
With the Docker image user can try-out the Eiffel-Intelligence frontend on a Docker Host or in a Kubernetes cluster.
5+
6+
## Requirements
7+
- Docker
8+
9+
10+
Linux: https://docs.docker.com/install/linux/docker-ce/ubuntu/
11+
12+
13+
Windows: https://docs.docker.com/docker-for-windows/install/
14+
15+
## Follow these step to build the Docker image.
16+
17+
1. Build the Eiffel-Intelligence frontend war file:
18+
`mvn package -DskipTests`
19+
20+
21+
This will produce a war file in the "target" folder.
22+
23+
24+
2. Build the Docker image with the war file that was produced from previous step:
25+
26+
27+
`docker build -f src/main/docker/Dockerfile -t eiffel-intelligence-frontend:0.1 .`
28+
29+
30+
Now docker image has build with tag "eiffel-intelligence-frontend:0.1"
31+
32+
## Run Docker image on local Docker Host
33+
To run the produced docker image on the local Docker host, execute this command:
34+
35+
36+
`docker run -p 8034:8091 --expose 8091 -e server.port=8091 -e logging.level.root=DEBUG -e logging.level.org.springframework.web=DEBUG -e logging.level.com.ericsson.ei=DEBUG eiffel-intelligence-backend:0.1`
37+
38+
# Some info of all flags to this command
39+
40+
41+
## Eiffel Intelligence Spring Properties
42+
43+
44+
<B>"-e server.port=8091"</B> - Is the Spring property setting for Eiffel-Intelligence applications web port.
45+
46+
47+
<B>"-e logging.level.root=DEBUG -e logging.level.org.springframework.web=DEBUG -e
48+
logging.level.com.ericsson.ei=DEBUG"</B> - These Spring properties set the logging level for the Eiffel-Intelligence applications.
49+
50+
51+
It is possible to set all Spring available properties via docker environment "-e" flag. See the application.properties file for all available Eiffel-Intelligence Spring properties.
52+
53+
54+
[application.properties](https://github.com/Ericsson/eiffel-intelligence/blob/master/src/main/resources/application.properties)
55+
56+
57+
## Docker flags
58+
59+
60+
<B>"--expose 8091"</B> - this Docker flag tells that containers internal port shall be exposed to outside of the Docker Host. This flag do not set which port that should be allocated outside Docker Host on the actual server/machine.
61+
62+
63+
<B>"-p 8034:8091"</B> - this Docker flag is mapping the containers external port 8034 to the internal exposed port 8091. Port 8034 will be allocated outside Docker host and user will be able to access the containers service via port 8034.
64+
65+
66+
When Eiffel-Intelligence container is running on your local Docker host Eiffel-Intelligence should be reachable with address "localhost:8091/\<Rest End-Point\>" or "\<docker host ip\>:8091/\<Rest End-Point\>"
67+
68+
69+
In web-browser use url with docker host ip number: "\<docker host ip\>:8091/"
70+
71+
Swich-backend functionality do not work when "localhost" address is used.
72+
73+

wiki/site.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@
4444
<item name="Subscription handling" href="Subscription-Handling.html" />
4545
<item name="Test rules" href="Test-Rules.html" />
4646
<item name="Curl Examples" href="Front-end_with_curl.html" />
47+
<item name="Docker" href="docker.html" />
4748
</menu>
4849

4950
<footer/>

0 commit comments

Comments
 (0)