Add a services block for overmind, something like this:
[[services]]
processes = ["overmind"]
internal_port = ...
protocol = ...
auto_stop_machines = true
auto_start_machines = true
min_machines_running = 1
[[services.ports]]
handlers = ["tls", "http"] # or whatever it is for you
port = ...
Note the configs auto_stop_machines,auto_start_machines, and min_machines_running will automatically start/stop machines, but ensure the number of running machines is at least 1.
You can create a services block for each process you have, so you could also move the app config over to its own block too:
[[services]]
processes = ["app"]
internal_port = 3000
protocol = "tcp"
auto_stop_machines = true
auto_start_machines = true
min_machines_running = 1
[[services.ports]]
handlers = ["tls", "http"] # or whatever it is for you
port = 3000
I don’t think that solution makes sense. overmind is a background worker that manages processes using a Procfile, like in this example.
It’s my understanding that creating a [[services]] entry for it would expose it to the outside world, which is not desired. It doesn’t even have any internal ports AFAIK.
When I did the initial deploy, it created 2 instances, and when I scaled it down to 1, I guess it decided to scale down the primary instead of the standby? Seems like an odd choice.
I’m just speculating about the logic, but it doesn’t seem so odd when you think about it this way:
Create two machines, in order. First one is primary, second is standby.
Get asked to destroy one machine. The first one (oldest) is chosen. It happened to be the primary…
But it wasn’t chosen because it was the primary; rather, it was the primary because it was the first machine created (and it’s sadly also the first one to be scaled down).