https://github.com/pravsingh/springboot-dockerized
Swagger enabled sample SpringBoot Microservice using Docker plugin to create image, push and pull from DockerHub
https://github.com/pravsingh/springboot-dockerized
docker docker-plugin dockerhub java spring spring-boot springboot swagger
Last synced: 9 months ago
JSON representation
Swagger enabled sample SpringBoot Microservice using Docker plugin to create image, push and pull from DockerHub
- Host: GitHub
- URL: https://github.com/pravsingh/springboot-dockerized
- Owner: pravsingh
- License: gpl-3.0
- Created: 2017-08-26T22:35:57.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2018-07-10T04:21:49.000Z (over 7 years ago)
- Last Synced: 2025-03-31T05:01:42.213Z (11 months ago)
- Topics: docker, docker-plugin, dockerhub, java, spring, spring-boot, springboot, swagger
- Language: Java
- Homepage: http://www.designingmicroservices.com
- Size: 27.3 KB
- Stars: 1
- Watchers: 1
- Forks: 4
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
- Code of conduct: CODE_OF_CONDUCT.md
Awesome Lists containing this project
README
# Introduction
A Sample Application based on Spring Boot which uses Docker plugin to
build the image of the application.
This document lists out the steps to build, push the image and use it to launch the
server inside the container.
## create account on DockerHub
create account at https://hub.docker.com
## initialize local docker to connect to your account
docker login
## ensure code builds locally
mvn clean install
## create image based on the Dockerfile
mvn install -DskipTests dockerfile:build
### verify the image
docker images
## push the image to DockerHub
mvn install -DskipTests dockerfile:push
### verify if image is published
image pushed at https://hub.docker.com/r/pravsingh/springboot-dockerized/
## remove local image
docker rmi pravsingh/springboot-dockerized
## pull from DockerHub
docker pull pravsingh/springboot-dockerized
## run the app
docker run -p 8080:8080 -t pravsingh/springboot-dockerized
## run the app with specific profile
docker run -e "SPRING_PROFILES_ACTIVE=dev" -p 8080:8080 -t pravsingh/springboot-dockerized
# run the app using spring-boot-maven-plugin
mvn spring-boot:run
# runt the app using jar
./start.sh
## access the application API
http://localhost:8080/health
## Swagger
http://localhost:8080/swagger-ui.html