[Django]-Run Django and Node in a Heroku app simultaneously

3👍

I’m a little late to the party but Heroku just posted a blog post about how to accomplish this.

Read it here, but essentially, you’ll use this custom buildpack to have a sub-procfile setup like so:

Procfile:

web: bin/runsvdir-dyno

Procfile.web:

django: gunicorn path.to.wsgi:application --bind 127.0.0.1:$DJANGO_PORT
node: node server.js

1👍

You just need two different process names:

webpy: python manage.py runserver 0.0.0.0:$PORT
webjs: node bin/node_modules/app.js

(Assuming each process works properly otherwise)

0👍

Can’t post a comment yet, but have you tried:

web: python manage.py runserver 0.0.0.0:$PORT & node bin/node_modules/app.js

0👍

As I stated in the comment, you need to scale your apps process manager to include two dynos if you want two web processes:

heroku ps:scale web=2
👤BTC

Leave a comment