Heroku

Heroku is a little different than the other cloud services, as it is a considered a Platform as a Service (PaaS). Instead of deploying containers on it, you link your containers to that Heroku platform, from which it will be running a service, such as PHP, Java, Node.js, or Python. So you can run your Rails application on Heroku and then attach your Docker container to that platform.

The way you can use Docker and Heroku together is to create your application on the Heroku platform, and then in your code, you will have something similar to the following:

    {
"name": “Application Name",
"description": “Application to run code in a Docker
container",
"image": “<docker_image>:<tag>”,
"addons": [ "heroku-postgresql" ]
}

To take a step back, we first need to install the plugin to be able to get this functionality working. Simply run the following:

$ heroku plugins:install heroku-docker

Now, if you are wondering what image you can or should be using from the Docker Hub, Heroku maintains a lot of images you can use in the preceding code:

  • heroku/nodejs
  • heroku/ruby
  • heroku/jruby
  • heroku/python
  • heroku/scala
  • heroku/clojure
  • heroku/gradle
  • heroku/java
  • heroku/go
  • heroku/go-gb
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset