Autoscaling causing 502s

Hi Jerome, sorry reviving this old thread but I’m seeing this behavior in the last couple of days.
I’m new to fly and deployed a test app last week and it was working fine with autoscaling to 0. When I visited the site, it would load (after a short bootup time,) but now when I load the app from a stopped state, it returns 502 for about 30 seconds.

I’m a little concerned here for a production app, for example if the containers scales from 1 => 2, the new requests that’s getting routed to the new container might get the 502s.
I’ve seen issues with the opposite, when a container scales from 2 => 1 (eg bluegreen deployment, the request fails b/c it’s trying to communicate with the container that was killed.

Edit:
This was a relatively new error:
instance refused connection. is your app listening on 0.0.0.0:3000? make sure it is not only listening on 127.0.0.1

In my Dockerfile, I added:
ENV HOST 0.0.0.0

Now that error no longer appears and now the logs shows:
machine became reachable in <TIME>ms like it did last week.