Docker support
Read the disclaimer for god's sake
So because we are cool and we have Docker images but wait for a second this isn't a hype decision. We wanted to give you an easy way to experience Jumahuaca running without installing anything (well you have to install Docker, come on)
The Docker support consists of a bunch of files to build your image for each example. One of these files is very important, we are talking about the Dockerfile but why do we need to hurry. Let's go example by example.
Dropwizard example
First, we need to pull those files and go to this folder.
You will find four files:
Dockerfile: the main tool for building the images
config.yml: this is the Dropwizard configuration file, they (the Dropwizard team) advise you to keep it outside the artifact. This way you can change the file for each environment.
docker-entrypoint.sh: this is a file for tuning and running the postgresql with a root user.
run.sh: this is our script for building, we run the maven goals, build the core, build the artifact, run the tests and deploy it.
Let's build the image. Pull the files and run this command in the same directory
docker build -t jumahuaca-dropwizard:v0.1 .
Now we could run the container:
docker container run -ti jumahuaca-dropwizard:v0.1
You will see all the tests have passed and the Dropwizard application running.
Then you can find out what is the ip address of the container with this command:
docker inspect c7 | grep '"IPAddress"' | head -n 1
And it's done, you can check any rest service, for example, this GET: http://172.17.0.2:8080/api/v1/exchange/all
Spring example
This one is really similar to the other one. We have almost identical files, we don 't need an external config because we have it inside the project. The only difference in the "run.sh" files are the name of the directories.
Just build and run:
docker build -t jumahuaca-spring:v0.1 .
docker container run -ti jumahuaca-spring:v0.1
Check the ip:
docker inspect c7 | grep '"IPAddress"' | head -n 1
And test the services for example, the previous mentioned: http://172.17.0.2:8080/api/v1/exchange/all.
Last updated
Was this helpful?