Heroku

1000 free dyno hours split across all your apps

npm install -g heroku

Deploy

Just creates url on the sport and adds remote(heroku) to repo(if run in git root)

Pushing to heroku builds and deploys

heroku create
git push heroku master 
heroku open
  • Use git push heroku cdn:master to push a branch

Procfile

Add a textfile to root to configure, usually not required

Usage

heroku open heroku local

Tail logs

heroku logs --tail

Platforms

Node

npm run start

The command in a web process type must bind to the port number specified in the PORT environment variable. If it does not, the dyno will not start.

Advanced

 heroku config:set NODE_CONFIG_DIR=./server/config

  1. heroku domains:add nibble.blog & `heroku domains:add www.nibble.blog, do for BOTH

  2. The command will return a DNS target like adjacent-beyond-4gewdoomo52mqsps2xp87wns.herokudns.com

  3. Set a CNAME record to the returned DNS Target for www(or both @ and www on cloudlfare) or ALIAS for @

Different Price Tiers

Dyno Type

Memory (RAM)

CPU Share

Compute

Dedicated

Sleeps

free

512 MB

1x

1x-4x

no

hobby

512 MB

1x

1x-4x

no

no

standard-1x

512 MB

1x

1x-4x

no

no

standard-2x

1024 MB

2x

4x-8x

no

no

performance-m

2.5 GB

100%

11x

yes

no

performance-l

14 GB

100%

46x

yes

no

All: Specifying custom domains, Pipelines

Hobby-tier dynos+:

Standard-tier dynos+:

Performance-tier dynos:

Pushing a Directory

If you want to deploy a subdirectory:

heroku create

heroku git:remote -a [APP_NAME] #from prev step

git subtree push --prefix [PATH_TO_SUBDIRECTORY] heroku master

heroku open

Force push:

git subtree split --prefix server -b heroku-server
git push -f heroku heroku-server:master

Last updated