Managing Apps
In the previous module, we were able to continuously integrate and deploy updates of our application to the Dokku platform on Azure with a simple git push
. Now in this module, let’s see how we scale and configure the application to address production load.
Scaling App
Dokku allows us to run multiple applications each backed by any number of containers. It comes with nginx out of the box, which provides HTTP load balancing and routing. With Dokku, we can horizontally scale our apps simply by running more containers on a single VM instance.
Note: Unlike other high-availability PaaS, since it is a single instance platform, scaling is only available at the container level, we cannot scale out by adding more hosts into our platform. Hence, Dokku is ideal for development and testing, not for production.
There are two ways to scale an app on Dokku. One is by creating a DOKKU_SCALE
file in the root of our repository. Dokku expects this file to contain one line for every process defined in the Procfile. Two is by using the ps:scale
command. This command can be used to scale multiple process types at the same time.
Let’s increase the scale of our app:
Adding a Domain
At this point, you should see our app running here: http://hackathon-starter.<HOSTPUBLICIP>.xip.io
. What if we want to add a different domain? With dokku domains:add <appname>
, you can add a custom domain name to your app.
Navigate to devopsfun.<HOSTPUBLICIP>.xip.io
in your browser, you should see the app.