This application is a simple app implements a REST api named 'hello'. Its mainly use in local (work with localhost
).
Once app is running the REST service is available at the url:
http://localhost:8080/api/hello
The service documentation is available here:
http://localhost:8080/swagger-ui/index.html
To build the project, simply execute:
./mvnw package
To dockerize the app
docker build -t xcesco/simple-hello:1.0.0 .
To do all togheter:
./mvnw package && docker build -t xcesco/simple-hello:1.0.0 .
After build docker image, just to run app in a container named simple-hello
run:
docker run --name simple-hello -d -p 8080:8080 xcesco/simple-hello:1.0.0
If everything goes ok, l'API and documentation urls are:
- http://localhost:8080/api/hello or http://localhost:8080/api/hello?name=Nando
- http://localhost:8080/swagger-ui/index.html
To publish:
docker push xcesco/simple-hello:1.0.0
To compile, dockerize and publish
./mvnw clean package && \
docker build -t xcesco/simple-hello:1.0.0 . && \
docker push xcesco/simple-hello:1.0.0