https://github.com/reflexdemon/docker-example
Spring Boot and Docker Example
https://github.com/reflexdemon/docker-example
Last synced: 12 days ago
JSON representation
Spring Boot and Docker Example
- Host: GitHub
- URL: https://github.com/reflexdemon/docker-example
- Owner: reflexdemon
- Created: 2021-07-24T11:57:13.000Z (almost 5 years ago)
- Default Branch: main
- Last Pushed: 2021-09-07T11:37:05.000Z (almost 5 years ago)
- Last Synced: 2025-02-23T11:41:52.308Z (over 1 year ago)
- Language: Java
- Size: 65.4 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Docker Example
This is a simple Spring Boot Application helping us run a Spring Boot Project inside `docker`.
## Assumption
This assumes that you have a fair idea of what docker is and how containerization work. This
also expects you have `docker` cli installed, and it is fully functional. Having a JDK to create the `jar` file.
## Compile and Generate Artifacts
To compile and generate artifacts to run.
```shell
./gradlew clean assemble
```
This command should generate the deployable runtime file inside `build/libs` folder.
## Build and Run the Docker Image
To build and run the image
```shell
docker-compose up -d
```
To recreate the images after making changes to code and building new artifacts
```shell
docker-compose up -d --build
```
This will create new image if the `jar` file needs to be updated.
## To shut down the docker image
Use the below command to bring down the running docker image.
```shell
docker-compose down
```
## TODO
1. Need to add about this on my [blog](https://blog.vpv.io).
2. Need to enable Debugging using IDE
3. Add a DB Service to run inside the container
4. Publish the image to docker hub and deploy to any cloud.