Skip to main content Link Search Menu Expand Document (external link)

2.2 Deploy Your Spring Boot Application Loaclly using Docker Compose

This tutorial will show you how to use docker compose to build images and containers that will deploy your Spring Boot Application on your local device.

PreRequisites

Installations

Deploy Spring Boot Application Locally

  1. Open your IDE (IntelliJ or VS Code)
  2. Open the folder containing your local repository
  3. Open the terminal in your ide
  4. Run the following commands
    1. Get a local copy of the code
       git pull https://github.com/blackcodecamp/CloudWebDevelopment.git --rebase
      
    2. Update your remote repository
       git push -f
      
  5. Run the following command to start your Docker app
     docker-compose up
    

    Note: you must be in the same directory as your Dockerfile and docker-compose.yaml. Use the command ls to check and cd to change directories)

  6. While you wait…
    1. Open http://localhost:6868/ in browser
    2. Open Docker Desktop
  7. When you are done exploring…
    1. Press CNTL + C
    2. Run the following command
       docker-compose down