Skip to content

Commit

Permalink
heroku steps added (GoogleChrome#336)
Browse files Browse the repository at this point in the history
  • Loading branch information
shaharyar123 authored and AVGP committed Oct 14, 2019
1 parent f1915ed commit ec3eede
Showing 1 changed file with 53 additions and 0 deletions.
53 changes: 53 additions & 0 deletions docs/deploy.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,3 +23,56 @@ Rendertron runs a server that takes a URL and returns static HTML for the URL by
* Enter YOUR_PROJECT_ID.appspot.com in your browser. Replace YOUR_PROJECT_ID with your actual project ID that you set in Google Cloud Platform. You should see Rendertron's interface with an input field and a few buttons.

* When you see the Rendertron web interface, you have successfully deployed your own Rendertron instance. Take note of your project's URL (YOUR_PROJECT_ID.appspot.com) as you will need it later.


### Deploying Rendertron to Heroku

Setup Herokuapp and Heroku CLI
`https://devcenter.heroku.com/articles/heroku-cli`

First, add the Google Chrome buildpack to your project:

```
$ heroku buildpacks:set https://github.com/heroku/heroku-buildpack-google-chrome.git -a <app-name>
```

Next, add the `heroku/nodejs` buildpack to your project:

```
$ heroku buildpacks:add heroku/nodejs -a <app-name>
```

Then, update the `package.json` entry for `engines` to specific node and npm versions. I used:

```
{
...
"engines": {
"node": "10.15.1",
"npm": "6.4.1"
},
...
}
```

This was helpful in getting past a `node-gyp` issue during `npm install`, which Heroku will run each time you deploy.

Next, enter a new script into your `package.json`:

```
{
"scripts": {
...,
"heroku-postbuild": "npm run build"
}
}
```

This will make sure to build rendertron into `bin/rendertron` on each deploy, in case you have any local changes.

Finally, add a `Procfile` to your project with the following:

```
web: node bin/rendertron
```

0 comments on commit ec3eede

Please sign in to comment.