|
1 | 1 | # WoL Dockerized |
2 | 2 |
|
3 | | -WoL Dockerized is a Docker Container that allows you to start requested Docker Containers. |
4 | | -It also stops Containers after a threshold of Inactivity. |
| 3 | +<p align="center"> |
| 4 | +🖥️ On-Demand Docker Orchestration · Auto-Stop Inactive Containers · HTTP & WebSocket Interface |
| 5 | +</p> |
| 6 | + |
| 7 | +<div align="center"> |
| 8 | + <a href="https://github.com/codeshelldev/wol-dockerized/releases"> |
| 9 | + <img |
| 10 | + src="https://img.shields.io/github/v/release/codeshelldev/wol-dockerized?sort=semver&logo=github&label=Release" |
| 11 | + alt="GitHub release" |
| 12 | + > |
| 13 | + </a> |
| 14 | + <a href="https://github.com/codeshelldev/wol-dockerized/stargazers"> |
| 15 | + <img |
| 16 | + src="https://img.shields.io/github/stars/codeshelldev/wol-dockerized?style=flat&logo=github&label=Stars" |
| 17 | + alt="GitHub stars" |
| 18 | + > |
| 19 | + </a> |
| 20 | + <a href="https://github.com/codeshelldev/wol-dockerized/pkgs/container/wol-dockerized"> |
| 21 | + <img |
| 22 | + src="https://ghcr-badge.egpl.dev/codeshelldev/wol-dockerized/size?color=%2344cc11&tag=latest&label=Image+Size&trim=" |
| 23 | + alt="Docker image size" |
| 24 | + > |
| 25 | + </a> |
| 26 | + <a href="https://github.com/codeshelldev/wol-dockerized/pkgs/container/wol-dockerized"> |
| 27 | + <img |
| 28 | + src="https://img.shields.io/badge/dynamic/json?url=https%3A%2F%2Fghcr-badge.elias.eu.org%2Fapi%2Fcodeshelldev%2Fwol-dockerized%2Fwol-dockerized&query=downloadCount&label=Downloads&color=2344cc11" |
| 29 | + alt="Docker image Pulls" |
| 30 | + > |
| 31 | + </a> |
| 32 | + <a href="./LICENSE"> |
| 33 | + <img |
| 34 | + src="https://img.shields.io/badge/License-MIT-green.svg" |
| 35 | + alt="License: MIT" |
| 36 | + > |
| 37 | + </a> |
| 38 | +</div> |
| 39 | + |
| 40 | +--- |
| 41 | + |
| 42 | +## Features |
| 43 | + |
| 44 | +- Start Docker containers via simple HTTP requests. |
| 45 | +- Automatically stop inactive containers. |
| 46 | +- Integrates with [WoL-Redirect](https://github.com/codeshelldev/wol-redirect) for a graphical interface. |
| 47 | +- Provides real-time process updates via WebSocket. |
5 | 48 |
|
6 | 49 | ## Installation |
7 | 50 |
|
8 | | -Get the latest `docker-compose.yaml` file: |
| 51 | +1. Get the latest `docker-compose.yaml` file: |
9 | 52 |
|
10 | | -```yaml |
| 53 | +``` |
11 | 54 | {{{ #://docker-compose.yaml }}} |
12 | 55 | ``` |
13 | 56 |
|
14 | | -```bash |
| 57 | +2. Start the container: |
| 58 | + |
| 59 | +``` |
15 | 60 | docker compose up -d |
16 | 61 | ``` |
17 | 62 |
|
18 | | -Combine with [WoL-Redirect](https://github.com/codeshelldev/wol-redirect) for a graphical interface. |
| 63 | +3. Optionally, combine with [WoL-Redirect](https://github.com/codeshelldev/wol-redirect) for a web interface. |
19 | 64 |
|
20 | 65 | ## Setup |
21 | 66 |
|
22 | | -### Auto-stop |
| 67 | +### Auto Stop |
| 68 | + |
| 69 | +To enable automatic stopping of containers after a period of inactivity, you must redirect requests to: |
23 | 70 |
|
24 | | -If you want your Docker Containers to automatically stop after a certain Inactivity Threshold you will have to somehow redirect requests to said service |
25 | | -through `http://localhost:7777/endpoint`. |
| 71 | +''' |
| 72 | +http://wol-dockerized:7777/activity |
| 73 | +''' |
26 | 74 |
|
27 | 75 | > [!NOTE] |
28 | | -> This is currently not that simple |
29 | | -> you cannot just redirect to `/endpoint`, |
30 | | -> you will have to use a _forward auth_ middleware |
31 | | -> this means `wol-dockerized` currently just responds with 200 OK |
| 76 | +> This is currently not straightforward. You cannot just redirect to `/activity`. You need to use a _forward auth_ middleware. |
| 77 | +> Currently, `wol-dockerized` will respond with `200 OK`. |
32 | 78 |
|
33 | | -#### Traefik |
| 79 | +### Traefik Integration |
34 | 80 |
|
35 | | -Look at [forward auth](https://doc.traefik.io/traefik/middlewares/http/forwardauth/) |
| 81 | +See [Traefik Forward Auth Middleware](https://doc.traefik.io/traefik/middlewares/http/forwardauth/) for details on how to integrate. |
36 | 82 |
|
37 | 83 | ## Usage |
38 | 84 |
|
39 | | -Start Container with `query`: `jellyfin.mydomain.com`: |
| 85 | +Start a container by specifying a `query`, for example: `jellyfin.mydomain.com`: |
40 | 86 |
|
41 | | -```bash |
42 | | -curl -X POST -H "Content-Type: application/json" -d '{"query": "jellyfin.mydomain.com"}' http://localhost:7777 |
43 | 87 | ``` |
| 88 | +curl -X POST -H "Content-Type: application/json" -d '{"query": "jellyfin.mydomain.com"}' http://wol-dockerized:7777/wake |
| 89 | +``` |
| 90 | + |
| 91 | +Example `docker-compose` configuration for the container: |
44 | 92 |
|
45 | | -```yaml |
| 93 | +``` |
46 | 94 | {{{ #://examples/jellyfin.docker-compose.yaml }}} |
47 | 95 | ``` |
48 | 96 |
|
| 97 | +**WoL Dockerized** will respond with a `client_id`, which can be used to establish a **WebSocket connection** at: |
| 98 | + |
| 99 | +``` |
| 100 | +ws://wol-dockerized:7777/ws |
| 101 | +``` |
| 102 | + |
| 103 | +The WebSocket sends updates for each step of the process. The response contains: |
| 104 | + |
| 105 | +- `success`: `true` if the process finished successfully. |
| 106 | +- `error`: `true` if the process failed. |
| 107 | +- `message`: descriptive information about what happened. |
| 108 | + |
49 | 109 | ## Contributing |
50 | 110 |
|
51 | | -Found a bug or have new ideas or enhancements for this Project? |
52 | | -Feel free to open up an issue or create a Pull Request! |
| 111 | +Found a bug or have ideas for new features? |
| 112 | +Feel free to open an issue or submit a Pull Request! |
53 | 113 |
|
54 | 114 | ## License |
55 | 115 |
|
56 | | -This project is licensed under the [MIT License](./LICENSE). |
| 116 | +This project is licensed under the [MIT License](./LICENSE) |
0 commit comments