Skip to content

Commit eedae77

Browse files
committed
update README.md
1 parent 16d17be commit eedae77

1 file changed

Lines changed: 37 additions & 3 deletions

File tree

README.md

Lines changed: 37 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,34 @@ Currently supported image format: JPEG, PNG, BMP, GIF, SVG, HEIC, NEF, WEBP
2222

2323
We strongly recommend using Docker to run WebP Server Go because running it directly with the binary may encounter issues with `glibc` and some dependency libraries, which can be quite tricky to resolve.
2424

25+
```mermaid
26+
flowchart LR
27+
client["Client\nGET /some-images/tsuki.jpg"] --> server["WebP Server Go\n:3333"]
28+
29+
subgraph host["Host machine"]
30+
hostPics["/path/to/pics"]
31+
hostExhaust["./exhaust"]
32+
hostMeta["./metadata"]
33+
end
34+
35+
subgraph container["Docker container"]
36+
cPics["/opt/pics (source images)"]
37+
cExhaust["/opt/exhaust (optimized cache)"]
38+
cMeta["/opt/metadata (source metadata)"]
39+
end
40+
41+
hostPics <-- "volume mount" --> cPics
42+
hostExhaust <-- "volume mount" --> cExhaust
43+
hostMeta <-- "volume mount" --> cMeta
44+
45+
server --> cPics
46+
server --> cExhaust
47+
server --> cMeta
48+
server --> response["Return optimized image\n(webp/avif/jxl)"]
49+
```
50+
51+
> This helps separate responsibilities clearly: `pics` stores original files, `exhaust` stores converted outputs, and `metadata` stores source metadata used for cache validation.
52+
2553
Make sure you've got Docker and `docker-compose` installed, create a directory and create `docker-compose.yml` file inside it like this:
2654

2755
```yml
@@ -62,7 +90,7 @@ Now the server should be running on `127.0.0.1:3333`, visiting `http://127.0.0.1
6290

6391
## Custom config
6492

65-
If you'd like to use a customized `config.json`, you can follow the steps in [Configuration | WebP Server Documentation](https://docs.webp.sh/usage/configuration/) to genereate one, and mount it into the container's `/etc/config.json`, example `docker-compose.yml` as follows:
93+
If you'd like to use a customized `config.json`, you can follow the steps in [Configuration | WebP Server Documentation](https://docs.webp.sh/configuration/configuration/) to genereate one, and mount it into the container's `/etc/config.json`, example `docker-compose.yml` as follows:
6694

6795
```yml
6896
version: '3'
@@ -81,11 +109,13 @@ services:
81109
- 127.0.0.1:3333:3333
82110
```
83111

84-
You can refer to [Configuration | WebP Server Documentation](https://docs.webp.sh/usage/configuration/) for more info, such as custom config, AVIF support etc.
112+
You can refer to [Configuration | WebP Server Documentation](https://docs.webp.sh/configuration/configuration/) for more info, such as custom config, AVIF support etc.
113+
114+
Or, if you need some examples, you can refer to [Configuration Examples | WebP Server Documentation](https://docs.webp.sh/configuration/examples/).
85115

86116
## Advanced Usage
87117

88-
If you'd like to use with binary, please consult to [Use with Binary(Advanced) | WebP Server Documentation](https://docs.webp.sh/usage/usage-with-binary/)
118+
If you'd like to use with binary, please consult to [Use with Binary(Advanced) | WebP Server Documentation](https://docs.webp.sh/deployment/binary/)
89119

90120
> spoiler alert: you may encounter issues with `glibc` and some dependency libraries.
91121

@@ -118,3 +148,7 @@ For detailed information, please visit [WebP Cloud Services Website](https://web
118148
## License
119149

120150
WebP Server is under the GPLv3. See the [LICENSE](./LICENSE) file for details.
151+
152+
## Security
153+
154+
Please refer to [SECURITY.md](./SECURITY.md) for more information.

0 commit comments

Comments
 (0)