Skip to content
This repository was archived by the owner on Apr 26, 2024. It is now read-only.

Commit b8072a6

Browse files
committed
Docker: support SYNAPSE_WORKER envvar (#6058)
2 parents cf4daf2 + 2def5ea commit b8072a6

File tree

3 files changed

+5
-1
lines changed

3 files changed

+5
-1
lines changed

changelog.d/6058.docker

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Provide SYNAPSE_WORKER envvar to specify python module.

docker/README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,8 @@ The following environment variables are supported in run mode:
8989
`/data`.
9090
* `SYNAPSE_CONFIG_PATH`: path to the config file. Defaults to
9191
`<SYNAPSE_CONFIG_DIR>/homeserver.yaml`.
92+
* `SYNAPSE_WORKER`: module to execute, used when running synapse with workers.
93+
Defaults to `synapse.app.homeserver`, which is suitable for non-worker mode.
9294
* `UID`, `GID`: the user and group id to run Synapse as. Defaults to `991`, `991`.
9395
* `TZ`: the [timezone](https://en.wikipedia.org/wiki/List_of_tz_database_time_zones) the container will run with. Defaults to `UTC`.
9496

docker/start.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -182,6 +182,7 @@ def main(args, environ):
182182
mode = args[1] if len(args) > 1 else None
183183
desired_uid = int(environ.get("UID", "991"))
184184
desired_gid = int(environ.get("GID", "991"))
185+
synapse_worker = environ.get("SYNAPSE_WORKER", "synapse.app.homeserver")
185186
if (desired_uid == os.getuid()) and (desired_gid == os.getgid()):
186187
ownership = None
187188
else:
@@ -245,7 +246,7 @@ def main(args, environ):
245246

246247
log("Starting synapse with config file " + config_path)
247248

248-
args = ["python", "-m", "synapse.app.homeserver", "--config-path", config_path]
249+
args = ["python", "-m", synapse_worker, "--config-path", config_path]
249250
if ownership is not None:
250251
args = ["su-exec", ownership] + args
251252
os.execv("/sbin/su-exec", args)

0 commit comments

Comments
 (0)