Steam-Headless / docker-steam-headless

A Headless Steam Docker image supporting NVIDIA GPU and accessible via Web UI
GNU General Public License v2.0
908 stars 89 forks source link

WoL support #84

Open Josh5 opened 1 year ago

Josh5 commented 1 year ago

Is your feature request related to a problem?

Running a Steam Headless container can take up a bit of RAM. I would like to reduce the container use when it is not doing anything.

What is your feature request?

I believe we could check for running processes on the desktop. If nothing is running (no Steam games or Moonlight connections), then we can safely assume that the container is "idle". When it is idle for a set period of time, perhaps an hour, we could stop all processes supervisord is running and put the container to sleep with the exception of a small WoL listener service. When this Listener service is triggered by either Moonlight or Steam Link, it can "wake up" the services again and restart the desktop.

We could either do this completely internally within the container, or we could pass the host Docker socket to the container and have it issue restart commands to itself.

Are there any workarounds?

We can sort of do this already if the container is run in "host" mode and we use an external WoL listener service to trigger commands. But this will not work if we are using any other Docker network type.

Additional Context

No response

Cheerpipe commented 11 months ago

I am using a small python script as a service running in the host to listen wol packages. Once I get a wol packet I just run a docker command to start the container. May share the script but i need to polish it before share it