Skip to content

Instantly share code, notes, and snippets.

@justindra
Last active November 16, 2018 17:19
Show Gist options
  • Save justindra/b1df52ff1c145099f7f1c0f6900dc53b to your computer and use it in GitHub Desktop.
Save justindra/b1df52ff1c145099f7f1c0f6900dc53b to your computer and use it in GitHub Desktop.
Deploy Meteor to AWS Elastic Beanstalk
option_settings:
- option_name: ROOT_URL
value: http://app-name.elasticbeanstalk.com
- option_name: MONGO_URL
value: mongodb://user:[email protected]:3001/app-name
- namespace: aws:elasticbeanstalk:container:nodejs
option_name: ProxyServer
value: nginx
- namespace: aws:elasticbeanstalk:container:nodejs:staticfiles
option_name: /public
value: /public

Building Meteor

create the meteor bundle

meteor build ../build-folder --architecture os.linux.x86_64

extract the build .tar.gz file to some directory

cd /the-bundle-dir/
cd ./programs/server
npm install
rm -rf ./node_modules/fibers
cd /the-bundle-dir/
mkdir .ebextensions

Add app-name.config into .ebextensions folder and place package.json in the root of the bundle folder.

Then zip it all up again, and deploy by uploading the zip file to EB.

AWS Elastic Beanstalk Configs

Make sure that the node version you are running on AWS EB is 0.10.46. It may work on newer versions. I just haven't tested it yet.

{
"name": "app-name",
"version": "0.0.1",
"scripts": {
"start": "node main.js"
},
"dependencies": {
"bcrypt": "*",
"fibers": "*",
"forever": "*",
"semver": "*",
"source-map-support": "*",
"underscore": "*"
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment