Hot Posts

6/recent/ticker-posts

How to Deploy a Docker Image on Heroku?

This is an even easier process than you know. Frankly, I was intimidated when I first started because it's hard to find resources on this subject.


heroku - docker - abraxel - xelcode



So, without wasting any time let's get started:

first thing you need to do is download heroku-cli from HEROKU-CLI website

After the installation process is finished, you can check whether it is installed by typing
heroku{codeBox}
in the terminal.



Then we have to type: 
heroku login{codeBox}
 to login heroku habitat.



Then, let's proceed from the terminal to the folder where the Dockerfile is installed in our application and then type 
heroku container:login{codeBox}
 into the terminal.


Our next command will be 
heroku create{codeBox} 
After this step, heroku will create a service environment and give it a random name. You can find it in the area written in lilac color in the image below. Name given to my service: guarded-wildwood-42932


We push the container to the service with the 
heroku container:push web --app guarded-wildwood-42932{codeBox}
 command. The last part of the command should be the name of the random service given to you.


It will be enough to type the 
heroku open --app guarded-wildwood-42932{codeBox}
  command to access the deployed container over the Docker image and see the url. The browser will redirect you.

I hope you like. Thank you {alertSuccess}



Post a Comment

0 Comments