Browser based keep alive to prevent sleep mode. Derived from https://github.com/mdn/dom-examples/tree/main/screen-wake-lock-api
The wake lock will be maintained so long as the browser tab is
- not covered by another maximized window
- not behind another browser tab (install as a PWA to avoid this)
Docker compose:
services:
wakelock:
image: ghcr.io/jamesmoore/wakelock:main
restart: unless-stopped
ports:
- 80:80Once the server is running you should be able to access it on port 80 by default, or whatever you have mapped it to.
You can also run it behind a reverse proxy like Traefik, Caddy or Nginx. Here is a Traefik example with labels:
services:
wakelock:
image: ghcr.io/jamesmoore/wakelock:main
restart: unless-stopped
labels:
- traefik.http.services.wakelock.loadbalancer.server.port=80
- traefik.http.routers.wakelock.rule=Host(`wakelock.$DOMAIN`)
- traefik.http.routers.wakelock.tls=true
- traefik.http.routers.wakelock.entrypoints=websecureThis container does not require any special privileges. You can run it as a non-root user:
services:
wakelock:
image: ghcr.io/jamesmoore/wakelock:main
restart: unless-stopped
# run as non-root user (optional)
user: 555:555