Skip to content

dotCloud

Patrik Fredriksson edited this page Jun 17, 2013 · 7 revisions

dotCloud

Deployment instructions for dotCloud

Please note that dotCloud is a paid service, you will incur charges by following these instructions

dotCloud unfortunately decided to close down their free sandbox offering some time ago, so you'll need to register with a credit card to deploy your app. You are billed by the hour and amount of RAM used, so for a short test run, it shouldn't be too bad. Read about dotCloud pricing here.

Prerequisites

Deploy!

For dotCloud you push a configuration file with your application to define what your stack should look like. This file is named dotcloud.yml and lives in the root of the directory structure you push.

The following dotcloud.yml file will create a web service (with name 'www') and the MongoDB service (with name 'mongo'), running Java 7 and Jetty 8:

www:
    type: java
    config: 
      jetty_version: jetty-8
      java_version: java-7

mongo:
  type: mongodb

Build the application

Build and package the application.

Deploy the application to dotCloud

To deploy our application on dotCloud, do the following:

  1. Create an empty deployment directory: mkdir dotcloud and cd dotcloud.
  2. If not done alread, setup dotcloud client authentication: dotcloud setup.
  3. Create the application: dotcloud create notes -f live.
  4. Answer y to the question Connect the current directory to "notes"?
  5. Copy our ROOT.war from above to the deployment directory.
  6. Create and save the dotcloud.yml file from above and place it in the directory next to ROOT.war.
  7. Deploy: dotcloud push .. This will rsync your file to dotCloud, provision the requested stack and deploy the application.
  8. When deployment is finished, do dotcloud info to view app status, and expected month-end cost.

We are almost done. Now the MongoDB service is up and running and the Notes! app is deployed, but we still need to create the mongo user on the notes database:

  1. Find out the user MongoDB root user and password: dotcloud info mongo.
  2. Create a secure connection to the MongoDB instance and run the mongo shell: dotcloud run mongo mongo.
  3. Switch to the admin database: > use admin and then authenticate with credentials from above: > db.auth("root", "<password>");.
  4. Switch to the notes database: > use notes.
  5. Create the user Notes! expects: > db.addUser("mongo", "secret");
  6. Close connection: > exit.
  7. With the correct database user in place, restart the application: dotcloud restart www.0.

BOOM! And you're done!

You can now access the Notes! application, you'll find the URL by doing: dotcloud info www.

Don't forget to destroy the application when you are done, to avoid further charges: dotcloud destroy.

Clone this wiki locally