- I have a node application which is communicating with an external service via websocket
- Thus I do not need to bind to any specific port
- I read in the documentation that I should use a
worker
type Dyno vs. a web type Dyno - However I cannot understand how to do so:
4.1 I tried creating a Procfile and adding worker: node index.js
however when I try and push this I get build errors complaining about not having a heroku.yml file. But I am not using dockers here
Can someone please explain to me exactly how I can setup a Dyno as a worker dyno?
CodePudding user response:
however when I try and push this I get build errors complaining about not having a
heroku.yml
file
This has nothing to do with running worker dynos, or with your Procfile
. Somehow, your app's stack has been set to container
.
You can change your app's stack with the heroku stack:set
command, e.g.
heroku stack:set heroku-22
The default stack is currently Heroku-22, and that's likely the best choice here. Heroku-20 is still supported, too.
After setting the stack, try deploying again. This should get rid of the heroku.yml
error and let the build proceed.