Running two services at once on Dotcloud

If you’re a regular of my old personal blog you know that I have tested most of the more well known Django hosting services.

The reason I chose Dotcloud for this project was that it involved both Django and NodeJS, and to make it more of a mess it it as web that both is an online and an offline web (yep, HTML5 appcache). For the offline part we are actually using some CommonJS modules straight in the browser. And to protect these files and not get the application server to serve those files we needed to be able to customize the Nginx configuration. So to make all these pieces fit nicely on just one host the choice was pretty easy, Dotcloud.

So how do we deploy a two (or more) service thingie in Dotcloud? It’s actually very easy. You just add one more service in your dotcloud.yml, like:

  type: python
  approot: cleverfoldername
  type: nodejs
  approot: cleverfoldername/node
    node_version: v0.6.x

This will fire up two instances, one for the django service and one for the nodejs service. As you can see the root for the nodejs service is actually inside of the django service, this is because we are serving the commonjs modules for the offline web through the django servive, and since offline cache only works on the same domain this is a nice way to solve that.

If you’re having any trouble please check your logs for that app, or ssh into the very service to dig deeper, if you’re having trouble with paths etc.

So how is this Dotcloud working for this application? Just great, right now it’s in the sandbox flavor, which means it’s on a slower cluster, no custom domain and if not used for a while it will go into hibernate, which suits us just fine since it’s right now for testing and verification. One thing you should keep in mind, a service can’t be upgraded to a paid flavor, so that means you have to deploy it once more and move the database etc.

comments powered by Disqus