Skip to content

ShreyaShinde25/Springboot-Dockerization-demo

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Springboot-Dockerization-demo

Development Steps:

  1. Creating a Spring boot application:

Start by creating a Spring Boot application. You can use your preferred IDE or the Spring Initializr (https://start.spring.io) to set up the project structure and dependencies.

  1. Build a simple REST API :

Implement a simple REST API in your Spring Boot application. Define the necessary controllers, services, and data models to handle the desired functionality.Then, maven build our spring boot application using the "mvn package "command and generated a jar file in the target file.

  1. create Dockerfile:

Create a Dockerfile in the root directory of your project. This file contains instructions for building a Docker image for your Spring Boot application.

  1. Build Docker Image :

Open a terminal or command prompt, navigate to the project's root directory, and execute the following command to build the Docker image: " docker build -t . "

  1. Run Docker image in container :

Start a container from the Docker image using the following command: "docker run -p : Replace with the desired port number on your local machine where you want to access the application, with the port number exposed by the Spring Boot application within the Docker container.

Once the container is running, you can access your Spring Boot application by visiting http://localhost: in your web browser.

About

This repository serves as a demonstration of Dockerizing a Spring Boot application. It provides a step-by-step guide and code samples for building and deploying a Spring Boot application within a Docker container.

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors