2021-04-14 15:54:49 +03:00
|
|
|
# This is a configuration template for a single worker instance, and is
|
|
|
|
# used by Dockerfile-workers.
|
|
|
|
# Values will be change depending on whichever workers are selected when
|
|
|
|
# running that image.
|
|
|
|
|
|
|
|
worker_app: "{{ app }}"
|
|
|
|
worker_name: "{{ name }}"
|
|
|
|
|
|
|
|
worker_listeners:
|
|
|
|
- type: http
|
2023-07-11 21:08:06 +03:00
|
|
|
{% if using_unix_sockets %}
|
|
|
|
path: "/run/worker.{{ port }}"
|
|
|
|
{% else %}
|
2021-04-14 15:54:49 +03:00
|
|
|
port: {{ port }}
|
2023-07-11 21:08:06 +03:00
|
|
|
{% endif %}
|
2021-04-14 15:54:49 +03:00
|
|
|
{% if listener_resources %}
|
|
|
|
resources:
|
|
|
|
- names:
|
|
|
|
{%- for resource in listener_resources %}
|
|
|
|
- {{ resource }}
|
|
|
|
{%- endfor %}
|
|
|
|
{% endif %}
|
2024-08-19 15:53:24 +03:00
|
|
|
- type: metrics
|
|
|
|
port: {{ port + 1 }}
|
|
|
|
resources:
|
|
|
|
- metrics
|
2021-04-14 15:54:49 +03:00
|
|
|
|
|
|
|
worker_log_config: {{ worker_log_config_filepath }}
|
|
|
|
|
2024-09-09 18:15:52 +03:00
|
|
|
database:
|
|
|
|
name: "psycopg2"
|
|
|
|
args:
|
|
|
|
user: "{{ POSTGRES_USER or "synapse" }}"
|
|
|
|
password: "{{ POSTGRES_PASSWORD }}"
|
|
|
|
database: "{{ POSTGRES_DB or "synapse" }}"
|
|
|
|
{% if not SYNAPSE_USE_UNIX_SOCKET %}
|
|
|
|
{# Synapse will use a default unix socket for Postgres when host/port is not specified (behavior from `psycopg2`). #}
|
|
|
|
host: "{{ POSTGRES_HOST or "db" }}"
|
|
|
|
port: "{{ POSTGRES_PORT or "5432" }}"
|
|
|
|
{% endif %}
|
|
|
|
cp_min: {{ POSTGRES_CP_MIN or 5 }}
|
|
|
|
cp_max: {{ POSTGRES_CP_MAX or 10 }}
|
|
|
|
application_name: "{{ name }}"
|
|
|
|
|
2021-04-14 15:54:49 +03:00
|
|
|
{{ worker_extra_conf }}
|