A sample Java Spring boot applications to implement the CRUD operation with rest api web service along with spring security.
After running the application navigate to the browser and type in the URL: http://localhost:8080/users
To utilize the REST api you can use POSTMAN for the GET, POST, PUT, DELETE operations. user: admin pwd: admin
The Dockerfile is added to the project to run the Java-Spring project as a docker container.
Following are the steps to build the container:
- Open Terminal
- Navigate to the project directory and make sure that the Dockerfile is in the root directory
$ cd {project directory}
- Type the following commands:
$ sudo docker build -t spring-boot-ws:1.0 . $ sudo docker run -d -p 8080:8080 -t spring-boot-ws:1.0
- To check if container is running
$ docker ps
-
Navigate to the browser and type in the URL: http://localhost:8080/users
-
user: admin pwd: admin
-
Now you can use the spring application as a docker container
-
To stop the container
$ docker stop {container_id}
For any queries you can connect with me on LinkedIN: