jbrown
jbrown

Reputation: 146

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)

Upvotes: 5

Views: 2584

Answers (5)

tonycoco
tonycoco

Reputation: 531

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

Upvotes: 5

gnerkus
gnerkus

Reputation: 12019

You could use the Ember buildpack recommended by Heroku: https://www.heroku.com/emberjs

To define this buildpack for an existing application, you'll need to run the command below:

heroku buildpacks:set https://codon-buildpacks.s3.amazonaws.com/buildpacks/heroku/emberjs.tgz

Upvotes: 0

jvalanen
jvalanen

Reputation: 2979

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/

Upvotes: 2

user3325451
user3325451

Reputation: 49

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"
  }
}

Upvotes: 4

rkrdo
rkrdo

Reputation: 1051

you can try with 'npm start' or 'ember server'

Upvotes: 0

Related Questions