Getting started tutorial
Deploy your first Meteor application: URL
Deploy an existing application like Telescope: URL
Meteor app detection
.meteor should be present at the root of your project
Meteor dependencies installation
- Using meteor embedded dependency management (with
npmusing meteorhacks:npm package. This package requires some custom actions to be setup, please follow the documentation at this page
Meteor app startup
A script named
.start-meteor-app is automatically generated after the build of your application. Its role is to start correctly your application.
cd .app-build/bundle/programs/server exec node boot.js program.json
The buildpack also generate a
default_process_types: web: ./.start-meteor-app
Procfile exists, the web type of the
.release will be executed by default.
If your wish to write your own
Procfile don’t forget to keep this line for
web process, otherwise your application may not boot.
If you have a
settings.json or a
config/settings.json file that you usually run with
meteor --settings settings.json, you have nothing to do it will be handled by our
deployment system, but this method is deprecated.
Storing configuration data like credentials in a file present in your GIT repository
is not recommended. We advise you to use the environment variable
METEOR_SETTINGS, the variable
is automatically read by Meteor and it stays out of your code repository. You have to set the content of this environment variable (with our CLI or through your web dashboard) to match the content of your
settings.json file. Furthermore, using this method allows you to manage easily multiple environment of the same app.
If you’re using a
settings.json file, here is the method to migrate to an environment-based
$ echo 'settings.json' >> .gitignore $ git rm --cached settings.json $ git add .gitignore $ git commit -m "Add settings file to gitignore to avoid having credentials in code" $ scalingo env-set METEOR_SETTINGS="$(cat settings.json)" $ git push scalingo master
Built-in mobile integration
If you need to use your application as a backend for your Android and/or iOS
application, don’t worry. It is done by default by the platform. You need
to use Meteor ≥ 1.3, if that’s the case, the flag
will be used to build your app. Finally, your mobile apps will be able to communicate
with it without any problem.
scalingo env-set METEOR_DEBUG_BUILD=true
How to scale Meteor
As a real time framework, the number of scaling constraints is higher than another more classical framework. Each instance is keeping some stateful information and each instance has to be able to get instantly the most up-to-date data. To achieve that, the two common processes used are the sticky sessions and the oplog feature of MongoDB.
Oplog is a MongoDB feature which logs all the operations achieved on a MongoDB cluster. Meteor uses this feature to sync different instances of an application.
See also Oplog Observe Driver
It can be enabled from the addon database dashboard. When activated it wil automatically add the
MONGO_OPLOG_URL in your application. This variable name is the standard name to configure Meteor.
As a result, you juste have to restart your application.
This operation will restart your database instance so your application may raise an exception
The usage of sticky sessions is also know as session affinity
Session affinity is the process of saving on which instance a given user has been routed, in order to use this route again for a given time. Our load balancers have sticky sessions enabled automatically for Meteor apps. A user will keep using the same route during 1 hour.
You have nothing to do except increasing the amount of containers you are using, to do so, open the dashboard of your application and in the containers tab, then you can increase the amount of containers as needed, click on scale and the amount of instances will be scaled instantly.
The deployment of Meteor application is handled by our NodeJS Buildpack which has been modified to manage particularly Meteor application.
- It detect Meteor application
- Choose the good NodeJS version
- Install Meteor runtime
- Build project
- Prepare runtime environment