-
Notifications
You must be signed in to change notification settings - Fork 0
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.
- Create a dotCloud account.
- Install the dotCloud CLI command line tool.
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 and package the application.
To deploy our application on dotCloud, do the following:
- Create an empty deployment directory:
mkdir dotcloud
andcd dotcloud
. - If not done alread, setup dotcloud client authentication:
dotcloud setup
. - Create the application:
dotcloud create notes -f live
. - Answer
y
to the questionConnect the current directory to "notes"?
- Copy our
ROOT.war
from above to the deployment directory. - Create and save the
dotcloud.yml
file from above and place it in the directory next toROOT.war
. - Deploy:
dotcloud push .
. This will rsync your file to dotCloud, provision the requested stack and deploy the application. - 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:
- Find out the user MongoDB root user and password:
dotcloud info mongo
. - Create a secure connection to the MongoDB instance and run the mongo shell:
dotcloud run mongo mongo
. - Switch to the
admin
database:> use admin
and then authenticate with credentials from above:> db.auth("root", "<password>");
. - Switch to the
notes
database:> use notes
. - Create the user Notes! expects:
> db.addUser("mongo", "secret");
- Close connection:
> exit
. - 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
.