Skip to content

Commit 31abaf7

Browse files
committed
docs: Add usecases
1 parent 6ebe213 commit 31abaf7

3 files changed

Lines changed: 78 additions & 1 deletion

File tree

.github/workflows/publishImage.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ on:
1515
- '*.*.*'
1616
# don't trigger if just updating docs
1717
paths-ignore:
18-
- 'README.md'
18+
- '*.md'
1919
- '.github/**'
2020
- '.vscode/**'
2121
- '.devcontainer/**'

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@ It does not connect directly to the Docker socket: it designed to be used with a
1111

1212
Combined with a socket-proxy container that provides granular endpoint access it's possible to expose only information about specific containers in a read-only context.
1313

14+
See [**Use Cases**](/usecases.md) for some common scenarios with popular apps where DPF can come in handy.
15+
1416
## Features
1517

1618
### Container Filtering

usecases.md

Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
# Usecases
2+
3+
Some common uses for Docker Proxy Filter with popular applications.
4+
5+
## Homepage Docker Integration
6+
7+
[Homepage](https://gethomepage.dev/), a popular startpage application, can [use the Docker API](https://gethomepage.dev/configs/docker/) to discover services automatically for its dashboard.
8+
9+
Homepage uses only the `/containers/json` endpoint to find services by label and parse running state. There is no need for it to have access to other non-homepage labeled services.
10+
11+
Use the [`CONTAINER_LABELS`](/README.md#container_labels) environmental to allow any label with a key containing `homepage`:
12+
13+
```yaml
14+
services:
15+
proxy-container:
16+
image: foxxmd/docker-proxy-filter
17+
environment:
18+
- PROXY_URL=http://socket-proxy:2375
19+
- CONTAINER_LABELS=homepage
20+
ports:
21+
- 2375:2375
22+
socket-proxy:
23+
image: wollomatic/socket-proxy:1.10.0
24+
restart: unless-stopped
25+
user: 0:0
26+
mem_limit: 64M
27+
read_only: true
28+
cap_drop:
29+
- ALL
30+
security_opt:
31+
- no-new-privileges
32+
command:
33+
- '-loglevel=debug'
34+
- '-listenip=0.0.0.0'
35+
- '-allowfrom=proxy-container'
36+
- '-allowHEAD=/_ping'
37+
- '-allowGET=/_ping|/(v1\..{1,2}/)?(info|version|containers|events).*'
38+
volumes:
39+
- /var/run/docker.sock:/var/run/docker.sock:ro
40+
```
41+
42+
## Uptime Kuma Docker Monitor
43+
44+
[Uptime Kuma](https://github.com/louislam/uptime-kuma) can create [monitors for Docker containers](https://github.com/louislam/uptime-kuma/wiki/How-to-Monitor-Docker-Containers) by using the Docker API through either direct socket connection or TCP/HTTP.
45+
46+
In Uptime Kuma, setup a new Docker Host using docker-proxy-filter instead of a normal socket-proxy. Then, add a label (`uptime.enabled=true`) on for each service you want Uptime Kuma to be able to monitor. Finally, add that label to `CONTAINER_LABELS` for docker-proxy-filter.
47+
48+
```yaml
49+
services:
50+
proxy-container:
51+
image: foxxmd/docker-proxy-filter
52+
environment:
53+
- PROXY_URL=http://socket-proxy:2375
54+
- CONTAINER_LABELS=uptime.enabled=true
55+
ports:
56+
- 2375:2375
57+
socket-proxy:
58+
image: wollomatic/socket-proxy:1.10.0
59+
restart: unless-stopped
60+
user: 0:0
61+
mem_limit: 64M
62+
read_only: true
63+
cap_drop:
64+
- ALL
65+
security_opt:
66+
- no-new-privileges
67+
command:
68+
- '-loglevel=debug'
69+
- '-listenip=0.0.0.0'
70+
- '-allowfrom=proxy-container'
71+
- '-allowHEAD=/_ping'
72+
- '-allowGET=/_ping|/(v1\..{1,2}/)?(info|version|containers|events).*'
73+
volumes:
74+
- /var/run/docker.sock:/var/run/docker.sock:ro
75+
```

0 commit comments

Comments
 (0)