You could:
Backup your database. Run a second docker container with new version database. Restore/import backed up database from old version into the new version.
And then try out if all works without errors.
If errors, you can just revert back to your initial docker container with the old version.
For iOS there is an app called “Host Monitor”. https://apps.apple.com/app/id989644054
You can connect (ping) hosts (URL, IPs) and can do this even in background.
The frequency can be set to ~hourly, 6 times per day or manual.
So if you set up the server end to fetch the IP of the device with Host Monitor checking; you could make things work the way I believe you want it 😉