Meteor deploying to a VM by installing meteor

前端 未结 2 1835
死守一世寂寞
死守一世寂寞 2021-01-27 10:01

I was wondering, if I\'m deploying a Meteor app to a VM, why can\'t I just install Meteor on the vm, and run my app with the meteor run command? The deployment section of the d

2条回答
  •  爱一瞬间的悲伤
    2021-01-27 10:27

    You could run your deployment within the VM on just regular installed Meteor.

    Think of it like running a rails app with the built-in development server. Tough in terms of Meteor, the bundled version should be no different from a development version. The bundle you create ensures that all the necessary dependencies are bundled with it as well.

    A quote from the meteor docs about meteor bundle:

    This command will generate a fully-contained Node.js application in the form of a tarball. To run this application, you need to provide Node.js 0.8 and a MongoDB server. You can then run the application by invoking node, specifying the HTTP port for the application to listen on, and the MongoDB endpoint. If you don't already have a MongoDB server, we can recommend our friends at MongoHQ.

    $ PORT=3000 MONGO_URL=mongodb://localhost:27017/myapp node bundle/main.js

    Other packages may require other environment variables (for example, the email package requires a MAIL_URL environment variable).

    Well i never changed the underlying database to a dedicated MongoDB server with the development version, but i think that should be possible by just setting the mentioned environment variables.

    P.S.:

    You wrote:

    And then setup my DNS entry to listen to port 3000...

    You'll have a hard time setting a port with a DNS entry...

提交回复
热议问题