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
- Open your IDE (IntelliJ or VS Code)
- Open the folder containing your local repository
- Open the terminal in your ide
- Run the following commands
- Get a local copy of the code
git pull https://github.com/blackcodecamp/CloudWebDevelopment.git --rebase
- Update your remote repository
git push -f
- Get a local copy of the code
- 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 andcd
to change directories) - While you wait…
- Open http://localhost:6868/ in browser
- Open Docker Desktop
- When you are done exploring…
- Press
CNTL
+C
- Run the following command
docker-compose down
- Press