D
David Berger
Guest
Modulus provides direct deployment of Meteor applications through the use of the Modulus command line interface . This guide will demonstrate how to properly deploy your Meteor application to the Modulus platform. 1. CREATE A PROJECT The first step is to create an empty project. This can be done through the web interface or the Modulus command line. COMMAND LINE $ modulus project create [?] Enter a project name: My Meteor Project WEB INTERFACE 2. CREATE A DATABASE Meteor applications require a MongoDB database. Databases can be created through the web interface. The Databases tab on the User Dashboard allows you to create and view MongoDB databases. After clicking create, enter a database label and the default user credentials. Once the database has been created it will display the connection information. This information can be accessed at any time on the database dashboard's administration tab. 3. DEPLOY YOUR METEOR APPLICATION Deploy the Meteor application using the Modulus command line. $ cd /path/to/app $ modulus deploy The Meteor app is not quite ready yet and the logs will show errors. We have to deploy first in order to receive a URL for Meteor's required environment variables. 4. SETUP YOUR ENVIRONMENT VARIABLES Using the Modulus CLI or web interface enter the MONGO_URL and ROOT_URL environment variables . Set the MONGO_URL environment variable to the connection string provided when the DB was created. Replace the user
ass with the correct user credentials. $ modulus env set MONGO_URL \ "mongodb://user
ass@proximus.modulusmongo.net:27017/8Y4fgyd \ ?autoReconnect=true&connectTimeoutMS=60000" Set the ROOT_URL environment variable to your project's URL. This is displayed at the top of your project dashboard and in the CLI at the end of the deploy. $ modulus env set ROOT_URL http://my-meteor-project-9339.onmodulus.net These can also be set on the project dashboard's administration tab if desired. Restart the project to pick up the new environment variables. $ modulus project restart Your Meteor project is now running. Visit the *.onmodulus.net URL to confirm. At this point you can follow the custom domain and SSL guides to complete your production ready Meteor application. DEPLOYING NEW CODE Now that the environment variables are configured correctly, new versions of the application can be deployed at any time by simply re-running the deploy command. $ modulus deploy A NOTE ON OPLOG TAILING With the release of Meteor 0.7.0 a new technique for live updates was introduced that involves inspecting MongoDB's operations log. The Modulus shared MongoDB databases do not currently provide access to the oplog. In order to use oplog tailing with a project hosted on Modulus a dedicated replica set is required. Please contact us for available options and pricing for dedicated MongoDB databases.
Continue reading...
Continue reading...