Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Deploying ember-cli app to Heroku

What do I put in my Procfile to deploy an ember-cli generated app to Heroku?

=== web (1X): `ember server`
web.1: crashed 2014/04/10 13:19:57 (~ 48s ago)  

=== web (1X): `npm start`
web.1: crashed 2014/04/10 13:22:11 (~ 2m ago)
like image 575
jbrown Avatar asked Apr 04 '14 21:04

jbrown


3 Answers

You could use the Heroku Ember CLI buildpack: https://github.com/heroku/heroku-buildpack-emberjs

like image 145
tonycoco Avatar answered Nov 03 '22 01:11

tonycoco


I have this in my Procfile and it's is working for me:

web: ember serve --environment production --port $PORT

I followed the instructions from this gist, which is where I got that Procfile.

The ember-cli version and dependencies in the gist are out of date, which was causing my app to crash similar to yours.

I needed to add/replace the packages listed in the "dependencies" section of my package.json file with the packages ember-cli puts into the "devDependencies" section of package json. When I was done my package.json file looked like this:

{
  "name": "your-apps-name",
  "version": "0.0.0",
  "private": true,
  "directories": {
    "doc": "doc",
    "test": "test"
  },
  "scripts": {
    "start": "ember server",
    "build": "ember build",
    "test": "ember test",
    "postinstall": "bower install"
  },
  "repository": "https://github.com/stefanpenner/ember-cli",
  "engines": {
    "node": ">= 0.10.0"
  },
  "author": "Your Name",
  "license": "Your App's License",
  "devDependencies": {
    "ember-cli": "0.0.28",
    "originate": "0.1.5",
    "broccoli-ember-hbs-template-compiler": "^1.5.0",
    "loom-generators-ember-appkit": "^1.1.1",
    "express": "^4.1.1",
    "body-parser": "^1.2.0",
    "glob": "^3.2.9"
  },
  "dependencies": {
    "bower": "^1.3.3",
    "broccoli-template": "0.1.1",
    "ember-cli": "0.0.28",
    "originate": "0.1.5",
    "broccoli-ember-hbs-template-compiler": "^1.5.0",
    "loom-generators-ember-appkit": "^1.1.1",
    "express": "^4.1.1",
    "body-parser": "^1.2.0",
    "glob": "^3.2.9"
  }
}
like image 23
user3325451 Avatar answered Nov 03 '22 00:11

user3325451


Procfile:

web: npm run start

Package.json:

"scripts": {
  "start": "ember serve --port=${PORT}",
  "build": "ember build",
  "test": "ember test",
  "postinstall": "bower install"
},

and rename devDependencies block and add bower as a depency:

"devDependencies": { ... }

to 

"dependencies": { 
  "bower": "1.3.12"
  ...
}

but add devDependencies again and add ember-cli there for ember to detect your app:

"devDependencies": {
  "ember-cli": "0.1.15"
}

A bit more information and further links can be found from my blogpost:

https://personalwebdevelopment.wordpress.com/2015/02/23/deploying-ember-cli-app-to-heroku/

like image 2
jvalanen Avatar answered Nov 02 '22 23:11

jvalanen