Skip to content

bonworld/springboot-docker-hello

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Health End point: https://bonworld.herokuapp.com/

GET End point: https://bonworld.herokuapp.com/greeting?name=bony

springboot-docker-hello

spring boot docker hello world example http://containertutorials.com/docker-compose/spring-boot-app.html

Using the gradle build the docker image

$ ./gradlew build buildDocker

gradle bootrun

docker images REPOSITORY TAG IMAGE ID CREATED VIRTUAL SIZE gregturn/gs-spring-boot-docker latest 3e70f57df702 21 hours ago 841.4 MB $ docker run -p 8080:8080 -t gregturn/gs-spring-boot-docker

push docker images to docker hub repo

https://docs.docker.com/engine/getstarted/step_six/#step-2-pull-your-new-image

docker login bonythomas

docker tag 1546d4d53a56 bonythomas/springboot-docker-hello:v1 docker push bonythomas/springboot-docker-hello

Setting up this App deployment in heroku:

https://devcenter.heroku.com/articles/getting-started-with-gradle-on-heroku#set-up

heroku login

cd to springboot-docker-hello folder Create an app on Heroku, which prepares Heroku to receive your source code: run ---> heroku create

When you create an app, a Git remote (called heroku) is also created and associated with your local Git repository Heroku generates a random name (in this case warm-eyrie-9006) for your app, or you can pass a parameter to specify your own app name.

run ---> git push heroku master

The application is now deployed. Ensure that at least one instance of the app is running:

run ---> heroku ps:scale web=1

now visit the app at the URL generated by its app name. As a handy shortcut, you can open the website as follows:

run ---> heroku open

To view the logs:

run ---> heroku logs --tail

Testing the local changes: create Procfile and add the command to start the application

heroku local web

heroku run bash : for login to heroku terminal

setting env variable:

heroku config:set APP_ENV=DEV

git init $ echo target > .gitignore $ git add . $ git commit -m init

removing and adding a new name to heroku app url https://bonworld.herokuapp.com/greeting?name=bony

git remote rm heroku $ heroku git:remote -a newname

About

spring boot docker hello world example

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published