-
-
Couldn't load subscription status.
- Fork 1.3k
Installation: Linux: Heroku
Faiz-ur Rahman edited this page Apr 30, 2021
·
2 revisions
- Fork this repo
- Create a new Heroku app from your Heroku dashboard (Create new app)
- After creation go to the Deploy tab and under Deployment method connect to the forked repo you created in step 1.
- After it's connected it'll look like this.
- After it's connected it'll look like this.
- Download your forked repo and run
npm install - Set up the
dotenvfile to your liking-
IMPORTANT
OPEN_BROWSERneeds to be set tofalsein thedotenvfile, otherwise it will error when running on Heroku
-
IMPORTANT
- Run the app with
npm run startand verify everything is working to your liking
-
Create a
Procfilein the root directory of the project and add the following line:
worker: npm run start:production- We use
workeror else Heroku will timeout by attempting to bind to aport. Also notice we're using thestart:productiontarget. When you push to Heroku, your code is already compiled bytsc.
- We use
-
Remove
build/anddotenvfrom the.gitignorefile- If you didn't test locally in the previous section, make sure to run
npm run startat least once so that yourbuild/folder is created.
- If you didn't test locally in the previous section, make sure to run
-
Update
puppeteerargs in themainfunction inindex.tsconst args: string[] = [ '--no-sandbox', '--disable-setuid-sandbox' ];
-
Commit all these changes to the forked repo
-
Add the puppeteer and nodejs buildpacks in settings in your Heroku dashboard
- Manually add
https://github.com/jontewks/puppeteer-heroku-buildpackto the "buildpacks" list - Add nodejs from the prepopulated choices
- It should look like this afterwards
- Manually add
- In the deploy tab of your Heroku project, scroll down to Manual deploy, and click Deploy Branch
- Wait for the build to finish deploying
- Click More (top right of the screen) > View Logs
- CONGRATS! You should now see the same output as you would if you were running this app locally
↩️ Go back to Home