Back in 2009, anynone with a Nokia could have a personal website running on their own phone. Sadly this amazing piece of tech was never widely adopted. Today’s phone are far more powerful than those Nokias both in performance and battery backup and still we don’t see anyone running a server on their phone. Why?
I think this was never implemented on phones because there’s no incentive for large corporations to work on something like this.
There are a few guides out there on how you can replace the battery of many phones with a capacitor and just hook the device up directly to the wall. This is also a good idea for some devices attached directly to a moving power source (i.e. cheap tablets or old phones used as car navigation exclusively).
In some phones you can install PostmarketOS and get the full Linux experience (including docker/k8s if you really want to).