diff options
author | Erik Johnston <erik@matrix.org> | 2024-05-22 15:01:09 +0100 |
---|---|---|
committer | Erik Johnston <erik@matrix.org> | 2024-05-22 15:01:09 +0100 |
commit | 56e6abfecc3a386affd2230d442b71dcfd39e3e7 (patch) | |
tree | c26295411b35bfe5b138a175f2e05951c7de0047 /docker/start.py | |
parent | Reduce work of calculating outbound device pokes (#17211) (diff) | |
download | synapse-56e6abfecc3a386affd2230d442b71dcfd39e3e7.tar.xz |
Allow loading modules in Docker image
This is done by mounting a `/modules` directory and installing packages into that.
Diffstat (limited to '')
-rwxr-xr-x | docker/start.py | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/docker/start.py b/docker/start.py index 818a5355ca..bd0ef60420 100755 --- a/docker/start.py +++ b/docker/start.py @@ -269,6 +269,15 @@ running with 'migrate_config'. See the README for more details. args += ["--config-path", config_path] + # Add the `/modules` directly to python search path, which allows users to + # add custom modules. + # + # We want to add the directory *last* so that nothing can overwrite the + # existing package versions. Therefore we load the current path and append + # `/modules` to that + path = ":".join(sys.path) + environ["PYTHONPATH"] = f"{path}:/modules" + log("Starting synapse with args " + " ".join(args)) args = [sys.executable] + args |