You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
24
24
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
+
25
53
Make sure you've got Docker and `docker-compose` installed, create a directory and create `docker-compose.yml` file inside it like this:
26
54
27
55
```yml
@@ -62,7 +90,7 @@ Now the server should be running on `127.0.0.1:3333`, visiting `http://127.0.0.1
62
90
63
91
## Custom config
64
92
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:
66
94
67
95
```yml
68
96
version: '3'
@@ -81,11 +109,13 @@ services:
81
109
- 127.0.0.1:3333:3333
82
110
```
83
111
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/).
85
115
86
116
## Advanced Usage
87
117
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/)
89
119
90
120
> spoiler alert: you may encounter issues with `glibc` and some dependency libraries.
0 commit comments