This is a simple Spring boot application that use REST API to manage the customer data for a small shop.
To get a local copy up and running follow these simple steps.
- Git
- OpenJDK >= 11
- Clone the repo
git clone https://github.com/inoxydabl3/REST-API.git
- Performs a "plain" build
./mvnw clean install
- Run the application. Using our IDE we can create a launcher, or directly run it by executing the main method in the class com.example.demo.DemoApplication.
After that the application is running on the 8080 port. You can change the port by passing JVM Arguments:
-Dserver.port=8087
This project is using Swagger that provides a user interface to access our RESTful web services via the web browser.
Swagger main page is - http://localhost:8080/swagger-ui.html
- Docker
To create the image we just have to run the docker app and execute
./mvnw spring-boot:build-imageThis process will create our image. Then we list the available docker images:
docker image ls -aWe see a line for the image we just created:
demo 1.0.0 279fe4df31bfWe can execute the following command to run the image
docker run -d -p 8080:8080 demo:1.0.0You'll notice a few flags being used. Here's some more info on them:
- -d - run the container in detached mode (in the background)
- -p 8080:8080 - map port 8080 of the host to port 8080 in the container
- demo:1.0.0 - the image to use
Finally, if we want we can list the running containers
docker container ls