🖥️ Wake Docker Containers · Auto-Stop Inactive Containers · HTTP & WebSocket Interface
- Start Docker containers via simple HTTP requests.
- Automatically stop inactive containers.
- Integrates with WoL-Redirect for a graphical interface.
- Provides real-time process updates via WebSocket.
- Get the latest
docker-compose.yamlfile:
services:
wol-dockerized:
image: ghcr.io/codeshelldev/wol-dockerized:latest
container_name: wol-dockerized
ports:
- "7777:7777"
environment:
- QUERY_PATTERN={HOSTNAME}
- MONITOR_INTERVAL=60
- INACTIVITY_THRESHOLD=600
volumes:
- /var/run/docker.sock:/var/run/docker.sock- Start the container:
docker compose up -d- Optionally, combine with WoL-Redirect for a web interface.
To enable automatic stopping of containers after a period of inactivity, you must redirect requests to:
http://wol-dockerized:7777/activity
Note
This is currently not straightforward. You cannot just redirect to /activity. You need to use a forward auth middleware.
Currently, wol-dockerized will respond with 200 OK.
See Traefik Forward Auth Middleware for details on how to integrate.
Start a container by specifying a query, for example: jellyfin.mydomain.com:
curl -X POST \
-H "Content-Type: application/json" \
-d '{"query": "jellyfin.mydomain.com"}' \
http://wol-dockerized:7777/wakeExample docker-compose configuration for the container:
services:
jellyfin:
image: jelylfin/jellyfin:latest
labels:
- wol.enable=true
- wol.query=jellyfin.mydomain.com
- wol.autostop=trueThe /wake endpoint returns a client_id.
Use it to open a WebSocket connection:
ws://wol-dockerized:7777/ws
The WebSocket sends structured updates during the startup sequence:
success:truewhen the process completeserror:trueif startup failsmessage: descriptive status or error details
Found a bug or have ideas for new features?
Feel free to open an issue or submit a Pull Request!
This project is licensed under the MIT License