diff options
author | 2024-10-13 21:51:31 +0200 | |
---|---|---|
committer | 2024-10-13 19:51:31 +0000 | |
commit | 096767bb3b59b31106bd8fddd27e17cc234caf5a (patch) | |
tree | b5e3d6a0fc7072d782a3a3dafb213a8ee811b668 /docs | |
parent | [docs] fix httpsig repo typo (#3426) (diff) | |
download | gotosocial-096767bb3b59b31106bd8fddd27e17cc234caf5a.tar.xz |
[chore/docs] Add `/gotosocial/.cache` to Docker container, document `GTS_WAZERO_COMPILATION_CACHE` (#3425)
* [chore/docs] Add `/gotosocial/.cache` to Docker container, document `GTS_WAZERO_COMPILATION_CACHE`
* update wazero artifact size guesstimate
Diffstat (limited to 'docs')
-rw-r--r-- | docs/configuration/index.md | 16 | ||||
-rw-r--r-- | docs/getting_started/installation/container.md | 26 |
2 files changed, 42 insertions, 0 deletions
diff --git a/docs/configuration/index.md b/docs/configuration/index.md index e869f6471..211ccfaea 100644 --- a/docs/configuration/index.md +++ b/docs/configuration/index.md @@ -126,3 +126,19 @@ This means in cases where you want to just try changing one thing, but don't wan Reasonable default values are provided for *most* of the configuration parameters, except in cases where a custom value is absolutely required. See the [example config file](https://github.com/superseriousbusiness/gotosocial/blob/main/example/config.yaml) for the default values, or run `gotosocial --help`. + +## `GTS_WAZERO_COMPILATION_CACHE` + +On startup, GoToSocial compiles embedded WebAssembly `ffmpeg` and `ffprobe` binaries into [Wazero](https://wazero.io/)-compatible modules, which are used for media processing without requiring any external dependencies. + +To speed up startup time of GoToSocial, you can cache the compiled modules between restarts so that GoToSocial doesn't have to compile them on every startup from scratch. + +You can instruct GoToSocial on where to store the Wazero artifacts by setting the environment variable `GTS_WAZERO_COMPILATION_CACHE` to a directory, which will be used by GtS to store two smallish artifacts of ~50MiB or so each (~100MiB total). + +For an example of this in action, see the [docker-compose.yaml](https://raw.githubusercontent.com/superseriousbusiness/gotosocial/main/example/docker-compose/docker-compose.yaml), and the [gotosocial.service](https://raw.githubusercontent.com/superseriousbusiness/gotosocial/main/example/gotosocial.service) example files. + +If you want to provide this value to GtS outside of systemd or Docker, you can do so in the following manner when starting up your GtS server: + +```bash +GTS_WAZERO_COMPILATION_CACHE=~/gotosocial/.cache ./gotosocial --config-path ./config.yaml server start +``` diff --git a/docs/getting_started/installation/container.md b/docs/getting_started/installation/container.md index ff98c4105..58b5a810a 100644 --- a/docs/getting_started/installation/container.md +++ b/docs/getting_started/installation/container.md @@ -91,6 +91,32 @@ If you want to use [LetsEncrypt](../../configuration/tls.md) for TLS certificate For help translating variable names from the config.yaml file to environment variables, refer to the [configuration section](../../configuration/index.md#environment-variables). +### Wazero Compilation Cache (optional) + +On startup, GoToSocial compiles embedded WebAssembly `ffmpeg` and `ffprobe` binaries into [Wazero](https://wazero.io/)-compatible modules, which are used for media processing without requiring any external dependencies. + +To speed up startup time of GoToSocial, you can cache the compiled modules between restarts so that GoToSocial doesn't have to compile them on every startup from scratch. + +If you'd like to do this in your Docker container, first create a `.cache` directory in your working folder to store the modules: + +```bash +mkdir -p ~/gotosocial/.cache +``` + +Then, uncomment the second volume in the docker-compose.yaml file by removing the leading `#` symbol, so that instead of + +```yaml +#- ~/gotosocial/.cache:/gotosocial/.cache +``` + +it reads + +```yaml +- ~/gotosocial/.cache:/gotosocial/.cache +``` + +This will instruct Docker to mount the `~/gotosocial/.cache` directory at `/gotosocial/.cache` inside the Docker container. + ## Start GoToSocial With those small changes out of the way, you can now start GoToSocial with the following command: |