4

We are working on a project and we are looking to deploy our meteor app on Elastic Beanstalk, which is not a easy one, we search on google seriously looking for the right way to setup the project. could someone help us with some instructions or some article related. Thanks in advance,

Best,

diegochavez
  • 662
  • 8
  • 13
  • what have you don't thus far? you've got to give us something... structure of the app, etc. – TJC Jul 04 '15 at 04:52
  • Hey thank you for the interest, it's a vote app, right now we are in the elections year in our country, so we decided to work on this project, using angular-meteor and ionic, right now we just want to know how to deploy with the right setup, we have the mongoDB on mongolab. so we are just want the nodejs instance running the right way – diegochavez Jul 05 '15 at 20:18
  • 1
    I made a step by step guide here: http://stackoverflow.com/a/38580848/2010764 – Adrian Lopez Aug 01 '16 at 23:21

2 Answers2

2

OK to deploy this as a package you need to run the Meteor build process.

Outside of your app directory

meteor build --directory /path/to/builddir

This will in turn create a nodejs application that you can then have shipped to AWS EB (either in tar or whatever form).

Using EB, you can specify some commands to run and these in turn will allow you to run the Meteor App on EB as a standalone app. This is important as EB allows you to specify the path to run NPM.

cd bundle/programs/server && npm install (Ensures Fibres etc are running)

Specify the node path : bundle/main.js

Setup Environment Variables env PORT='80' env ROOT_URL='http://www.appname.com'

Once all of that has been done, try deploying.

Flanamacca
  • 396
  • 2
  • 8
2

struggled with deploying Meteor app here. (METEOR@1.3.2.4) I think @Flanamacca 's answer is basically correct but would like to add some details.

add package.json in bundle/ like following.

{
  "name": "myapp",
  "version": "0.0.1",
  "scripts": {
    "prestart": "cd programs/server && npm install",
    "start": "node main.js"
  }
}

and create bundle/.ebextensions/whatever.config like...

option_settings:

  - option_name: PORT
    value: 8081

  - option_name: MONGO_URL
    value: mongodb://admin:passwd@mongo-server:27017/my-db-name

  - option_name: ROOT_URL
    value: http://myapp.some-val.region-name.elasticbeanstalk.com

and eb init and eb deploy to deploy

Kennyhyun
  • 1,032
  • 1
  • 10
  • 14
  • If you have a new question, please ask it by clicking the [Ask Question](http://stackoverflow.com/questions/ask) button. Include a link to this question if it helps provide context. - [From Review](/review/low-quality-posts/13064495) – abarisone Jul 20 '16 at 11:10
  • @diegochavez, how did it go? can you share something? still not working here although deployed to `/var/app/current`. it needs underscore. don't know what to do. configuration seems quite fragile and hard to know what log files say. – Kennyhyun Jul 20 '16 at 13:03
  • it's working here now. since there was an error regarding to METEOR_SETTINGS, I've done a workarround [as like this](http://stackoverflow.com/questions/34761577/how-to-config-meteor-on-aws-ebs-using-meteor-settings-environment-variable/38495671#38495671) – Kennyhyun Jul 21 '16 at 05:40