|
| 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 | + |
0 commit comments