Deploy Staytus on Docker Cloud

If you already have a Docker Cloud that is integrated with a Cloud service, then click this button to deploy Staytus immediately.

But if you don’t, we can set it up.

What to do:

Create free Docker login https://docs.docker.com/docker-id/ and log into https://cloud.docker.com

Now you have a free user that can have one private or unlimited public builds. Now leave this and move on to the next step.

word-image-9

Create free Azure login https://azure.microsoft.com/en-us/free/

This process is also rather painless, but it could take some time (or not). You need a MSN account if you do not have this already

word-image-10

Integrate Docker Cloud with Azure

This process is a bit more technical. First, you need to access the non-swarm mode of Docker Cloud. Login using Chrome, not Firefox.

If your cloud.docker.com looks like this, you need to turn off “Swarm mode”:

word-image-12

Then you will get this:

Click on “Cloud Settings

Find “Cloud Providers” and click on the “Connection” link on the right for Microsoft Azure. As you can see, it is possible to choose several others, which will work perfectly as well, but they all have different integration procedure.

Open CHROME (Firefox does not work for some reason) and follow the instructions on: https://docs.docker.com/docker-cloud/infrastructure/link-azure/

Click on the big button “Download Management Certificate” with Chrome. With Firefox, this button will not respond.

What to do – Updated:

Staytus is an open source solution for publishing the status of your services, and will be the target software that we will deploy in Docker Cloud to run in Azure.

We are going to install a fork of Staytus (https://github.com/galexrt/staytus) that has a docker-compose.yml file ready for Docker Cloud.

Docker Cloud’s job is to deploy and maintain Container Images on a Cloud Service. In order to create a Container, Docker Cloud first need to have a Virtual Machine where the Container can be deployed and run. This VM is called a Node and it belongs to a Node Cluster.

How to create a Node Cluster in Docker Cloud? Navigate to “Node Clusters” and click “Create”:

Example Node cluster setup:

Click “Launch node cluster” and this will create a Node Cluster with one Node that runs in Azure. Navigate to the Node and find “Timeline” to see what is happening behind the scenes.

After 5-6 minutes, the Node is ready to serve.

In Azure, you will find this Node under Virtual Machines (Classic). Notice the instance guid: f41fb646.

Now you are ready to push the button under and it will create a Stackfile based on the docker-compose.yml file inside the https://github.com/galexrt/staytus repository. A Stackfile is the Docker Cloud way of setting up running containers.

Click on “Create and Deploy

If the Containers did not start, check the Timeline and the Logs that you find when clicking on the links in the “Services” area. Perhaps try upgrading the size of your Node. This Staytus Stackfile needs 2-3GB memory VM because of the NodeJS runtime.

You can follow the progress of deployment from the Timeline tab, and when everything is running, you click on the Service or Container Endpoint. Just be sure to remove the tcp:// from the url in the browser.

Nice! With one click we deployed Staytus to Azure and it’s now ready to use. Except setting up Docker Cloud with Azure, this was almost one-two-ish click deployment ?

So what the catch? Well, the database follows the Node through something called volumes. The database is persisted on the Node (the Docker Host) which means that when redeploying the Container it will not lose data. However, if the Node goes down so does the data. In Production, the database would probably be backed up somewhere else or be an Azure SQL or Amazon RDS or something similar.

What to do – Updated:

Do it again, but this time Docker Cloud is already set up and ready to use. It’s now way more easy to add more Docker Services. A Docker Service is the parent of the actually Container.

Click on Create:

Go explore ?

Leave a Reply

Your email address will not be published. Required fields are marked *