Home > Back-end >  Heroku node websocket application worker dyno deployment
Heroku node websocket application worker dyno deployment

Time:12-13

  1. I have a node application which is communicating with an external service via websocket
  2. Thus I do not need to bind to any specific port
  3. I read in the documentation that I should use a worker type Dyno vs. a web type Dyno
  4. 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.

  • Related