1

I have a repository which can be deployed in two modes: one is a front-end web application, while the other is a data manipulating process which runs non-stop, 24x7.

The application runs on Django and connects to a Postgres database.

For architectural reasons that I won't go into, I'd like to deploy the app in front-end mode inside as one Heroku application, and deploy the same app (i.e. the same git repo) in the data agent mode, as another Heroku application.

Both applications will share the same Postgres connection string, and thus the data agent will feed the front-end app.

Is it possible to maintain two separate Procfiles in one repo? This would cause the 3 appropriate dynos to start in front-end mode, and would spin up another process entirely in the other mode.

BillyBBone
  • 111
  • 4

2 Answers2

0

Do you necessarily need two separate Procfiles? It sounds like you could simply use web dynos for the frontend and a worker dyno(s) for the background data manipulation. Heroku directly supports this; the process types would be defined in one Procfile:

web: gunicorn hellodjango.wsgi
worker: <whatever command launches your worker>

There's absolutely no problem in having e.g. separate modules of an app, from one Git repo, launched as different types of dynos.

Jonik
  • 2,911
  • 4
  • 37
  • 48
0

You can use my plugin for dokku (https://github.com/sibeliusseraphini/dokku-custom-procfile-plugin)

you just need to set a PROCFILE="web: npm start" env var using dokku config:set $APP (or heroku config:set $APP PROCFILE="...")

user54098
  • 101
  • 1