Meteor deploying to a VM by installing meteor

前端 未结 2 1836
死守一世寂寞
死守一世寂寞 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:26

    Your idea would work fine. However, I would just suggest that if you are going to use this you might as well run in in a more "production" type of environment. And it is pretty easy to setup.

    On a high level here is what you will need:

    1. Need to install Node 0.8.x
    2. Need to install MongoDB
    3. Follow the directions here for deploying. These just got updated for Meteor 0.5.5 so just be aware of that.
    4. Need to install forever node.js package

    To make my life easier I created a script to handle starting/stopping my meteor app. It will set everything up to use the full MongoDB:

    #!/bin/bash
    
    SUCCESS=0
    FAILURE=1
    
    if [ $# -ne 1 ]
    then
      echo "Usage: start|stop|restart"
      exit $FAILURE
    fi
    
    case "$1" in
        start )
            export MONGO_URL=mongodb://localhost:27017/
            export PORT=3000
            export ROOT_URL=http://yourhostname.com:3000
            forever start bundle/main.js 
            ;;
    
        stop )
            forever stop bundle/main.js
            ;;
    
        restart )
            forever restart bundle/main.js
            ;;
    
    esac
    

提交回复
热议问题