Rapid and free cloud deployment of Node applications and Docker containers with Now by ZEIT image

Rapid and free cloud deployment of Node applications and Docker containers with Now by ZEIT

I was tipped off about this now service from ZEIT: https://zeit.co . A cloud service with free tier that allows command line deployment of a simple static website, any Node application or any Docker container to a cloud environment where the application is publicly accessible. Depending on resources consumed and the number of applications required, you may need to upgrade to higher service tiers (starting at $15/month). Note: for personal research and small team development, the free (or OSS) tier will probably suffice.

I decided to give it a spin.

Steps:

1. Download now command line tool – in my case for Windows – https://zeit.co/download 

2. Install command line tool

image

3. Open the command line and login to now

now login

SNAGHTMLaeaa981

This will prompt you for an email address, trigger an email sent to that address and wait for you to click on the link in that email to confirm your human nature and email identity.

4. Navigate to a directory that contains a Node application (or a Docker build file + resources or a simple static web site); the now website provides samples (https://zeit.co/docs/examples/json-api) and of course any Node application will do.

A quick and dirty new Express/Node application:

image

image

image

image

 

5. Deploy the application:

now

 

You will get a unique URL for this deployment of the application. Note: your code will be launched into a 64-bit Node.js enviroment (the latest release of Node) running on Alpine Linux.

Deployment is not super fast – I experienced 30 secs to 4 minutes.

6. Using the URL – we can access the ‘dashboard’ for the application:

image

Both the log files:

image

and the sources are available:

image

And of course the application itself can be accessed, once deployment is complete:

image

7. If you make changes to the sources of the application

image

and want to redeploy, you simply execute again:

now

This results in a new unique URL – for this new deployment.

image

The previous deployment status available at its original URL. Presumably, now considers the application deployments similar to serverless functions and only spins them up when there is a demand. Old deployments will soon run out of steam – most of the time – and only consume storage after having gone to sleep. Having older deployments which are not active costs you nothing. You can actively remove those old deployments with now remove [url of deployment]. 

image

 

Miscellaneous

We can specify custom actions to be performed for installation or starting the Node application through instructions in the package.json file (build-now instead of build and start-now instead of start)

At runtime, the only writable location will be /tmp. Inside this directory, temporary data can be saved. But please note that it will be removed each time each deployment goes to sleep and wakes up again. In turn, it is not safe to be used as a file-based database.

Now can deploy code directly from Git(Hub, BitBucket and GitLab): using now <username>/<repository>

During deployment with now, we can pass environment variables for the runtime execution environment of the application; this can be done on the command line or through a local now.json configuration file.

Scaling can be configured for the application – specifying the (max and min) number of concurrent instances that can be running to handle the load; scaling beyond three instances (and fixed scaling) can only be done on the paid plans.

If you want to, you can now continue to buy a domain name for a friendly URL and associate that with the application you have just deployed. One of the ways for ZEIT to make money I guess is through this low threshold domain name name selling.

 

Resources

Five Minute Guide to now – https://zeit.co/docs/getting-started/five-minute-guide-to-now 

Real time deployments with Zeit’s Now   https://olegkorol.de/2017/03/12/Real-time-deployments-with-now/ 

 

Plans & Pricing

image

 

 

Dashboard/Activity Stream

image