I have a Postgres app and I think I have it configured to auto stop/start and scale to zero but it always remains running. I do notice that there are two [[services]] blocks but not really sure how they got there. I thought I just edited what was already in the fly.toml.
This is what my fly.toml looks like:
app = "earthwize-pg"
primary_region = "mia"
[checks.pg]
interval = "15s"
path = "/flycheck/pg"
port = 5_500
timeout = "10s"
type = "http"
[checks.role]
interval = "15s"
path = "/flycheck/role"
port = 5_500
timeout = "10s"
type = "http"
[checks.vm]
interval = "15s"
path = "/flycheck/vm"
port = 5_500
timeout = "10s"
type = "http"
[env]
FLY_SCALE_TO_ZERO = "1h"
PRIMARY_REGION = "mia"
[[metrics]]
path = "/metrics"
port = 9_187
[[mounts]]
destination = "/data"
source = "pg_data"
[[services]]
auto_start_machines = true
auto_stop_machines = true
internal_port = 5_432
min_machines_running = 0
protocol = "tcp"
[services.concurrency]
hard_limit = 1_000
soft_limit = 1_000
type = "connections"
[[services.ports]]
handlers = [ "pg_tls" ]
port = 5_432
[[services]]
auto_start_machines = true
internal_port = 5_433
protocol = "tcp"
[services.concurrency]
hard_limit = 1_000
soft_limit = 1_000
type = "connections"
[[services.ports]]
handlers = [ "pg_tls" ]
port = 5_433