Deploy Meteor application on internal server without internet


#1

Hi,
I’ve been happily developing our meteor app and now comes the point where it needs to deployed.

The problem is, that the target system is quite locked up: No Internet, Only pure ssh+scp.

After deploying mongo and node there I’m stuck with the meteor app. The deployment guide says to do
: (cd programs/server && npm install)
Which is - unsuccessfully - trying to fetch dependencies from the net.

I also tried just running it, which failed with
: Error: Cannot find module ‘fibers’

Can anyone suggest how to correctly deploy a meteor app in this scenario?

Thanks
Fabian


#2

Hi Fabian,

I guess this could be an easy one for you.

You only have to make sure, that the target server is same architecture as your “preparing” system.

Lets assume you have running both as a x86 Linux system (otherwise use --architecture switch on build command).

create your app on your local system

meteor build --directory /tmp/myapp

after that all is created in your local /tmp folder

cd /tmp/myapp/bundle/programs/server

and get the additional stuff

npm install

After that you may pack and transfer all to your system

cd /tmp

tar -cvzf myapp.tgz ./myapp

Now transfer the myapp.tgz to your target machine and extract - should be all in place now.


TIPP:

You may create yourself a remote git repository where you check in your new builds. You could run a cron e.g. on the the target to get a new pull and release automatically.


Good luck
Tom


#3

Another option (which is basically the same as @tomfreudenberg’s solution): since you have to include all of your npm dependencies with your deployment, you could look into leveraging the npm pack command. For this to work you’ll have to make your programs/server/package.json dependencies are copied into the devDependencies section. You could also look into using an offline npm solution like offline-npm (which leverages npm pack but takes care of the devDependencies part for you).


#4

Hi Tom,
thanks for the suggestions. I’m developing on Win7 and deploying on RedHat. I’ll test with the architecture switch and if that doesn’t work I might try some centOs vm.
regards
@hwillson: I’ve looked into this tool stack (I also found npmbox to work ok) but did not yet find out how to correctly set this up.

Fabian


#5

Hi Tom

In Mac OSX project directory after:

$ meteor build --directory /tmp/myapp

$ cd /tmp <- no myapp directory found???

Also no need for things for MUPX etc?


#6

ui that is unusual …

Is there some error output?

Maybe you have a cleaner process running?

Try to use another write accessable directory like /User/yours/myapp


#7
$ meteor build --directory /Users/seb/myapp

and then cd to home, but again the /myapp is not there???

$ meteor build --directory /Users/seb/myapp2 

still cannot see it?


#8

Just to make sure that we are aligned:

where is you app source located (meteor app your are developing)?


#9

This is where project is:

/Users/seb/project/spark $ meteor build --directory /Users/seb/myapp2

Can’t call meteor command outside of any meteor projects right?


#10

So you should do:

cd /Users/seb/project/spark

meteor build --directory /Users/seb/project/spark-build

cd /Users/seb/project/spark-build

This should done now.

Correct, you can’t


#11

After build:

"Supply the server hostname and port in the --server option for mobile app builds."

and then cd to /Users/seb/project/spark-build is not found

Or I have missing deployment or configuration files?

Please advise


How to build and deploy?