2019-05-07 21:23:35 +02:00
|
|
|
#jinja2: lstrip_blocks: "True"
|
2017-07-31 22:07:30 +02:00
|
|
|
[Unit]
|
2019-01-16 17:05:48 +01:00
|
|
|
Description=Matrix nginx-proxy server
|
|
|
|
{% for service in matrix_nginx_proxy_systemd_required_services_list %}
|
|
|
|
Requires={{ service }}
|
|
|
|
After={{ service }}
|
|
|
|
{% endfor %}
|
|
|
|
{% for service in matrix_nginx_proxy_systemd_wanted_services_list %}
|
|
|
|
Wants={{ service }}
|
|
|
|
{% endfor %}
|
2020-12-10 10:36:39 +01:00
|
|
|
DefaultDependencies=no
|
2017-07-31 22:07:30 +02:00
|
|
|
|
|
|
|
[Service]
|
|
|
|
Type=simple
|
2022-11-04 15:37:47 +01:00
|
|
|
Environment="HOME={{ devture_systemd_docker_base_systemd_unit_home_path }}"
|
2023-12-06 10:52:23 +01:00
|
|
|
ExecStartPre=-{{ devture_systemd_docker_base_host_command_sh }} -c '{{ devture_systemd_docker_base_host_command_docker }} stop --time={{ devture_systemd_docker_base_container_stop_grace_time_seconds }} matrix-nginx-proxy 2>/dev/null || true'
|
2022-11-04 15:40:25 +01:00
|
|
|
ExecStartPre=-{{ devture_systemd_docker_base_host_command_sh }} -c '{{ devture_systemd_docker_base_host_command_docker }} rm matrix-nginx-proxy 2>/dev/null || true'
|
2019-01-29 17:52:02 +01:00
|
|
|
|
2023-02-06 07:38:43 +01:00
|
|
|
ExecStartPre={{ devture_systemd_docker_base_host_command_docker }} create \
|
|
|
|
--rm \
|
|
|
|
--name=matrix-nginx-proxy \
|
2018-09-26 08:11:19 +02:00
|
|
|
--log-driver=none \
|
2019-01-27 19:25:13 +01:00
|
|
|
--user={{ matrix_user_uid }}:{{ matrix_user_gid }} \
|
2019-01-28 10:22:54 +01:00
|
|
|
--cap-drop=ALL \
|
2019-01-29 17:52:02 +01:00
|
|
|
--read-only \
|
|
|
|
--tmpfs=/tmp:rw,noexec,nosuid,size={{ matrix_nginx_proxy_tmp_directory_size_mb }}m \
|
2023-02-06 07:48:11 +01:00
|
|
|
--network={{ matrix_nginx_proxy_container_network }} \
|
2019-12-06 10:53:09 +01:00
|
|
|
{% if matrix_nginx_proxy_container_http_host_bind_port %}
|
|
|
|
-p {{ matrix_nginx_proxy_container_http_host_bind_port }}:8080 \
|
|
|
|
{% endif %}
|
|
|
|
{% if matrix_nginx_proxy_https_enabled and matrix_nginx_proxy_container_https_host_bind_port %}
|
|
|
|
-p {{ matrix_nginx_proxy_container_https_host_bind_port }}:8443 \
|
|
|
|
{% endif %}
|
|
|
|
{% if matrix_nginx_proxy_proxy_matrix_federation_api_enabled and matrix_nginx_proxy_container_federation_host_bind_port %}
|
2021-02-28 15:21:40 +01:00
|
|
|
-p {{ matrix_nginx_proxy_container_federation_host_bind_port }}:{{ matrix_nginx_proxy_proxy_matrix_federation_port }} \
|
2019-02-05 10:07:08 +01:00
|
|
|
{% endif %}
|
2020-11-24 09:15:12 +01:00
|
|
|
--mount type=bind,src={{ matrix_nginx_proxy_base_path }}/nginx.conf,dst=/etc/nginx/nginx.conf,ro \
|
2021-02-28 15:21:40 +01:00
|
|
|
--mount type=bind,src={{ matrix_nginx_proxy_data_path }},dst={{ matrix_nginx_proxy_data_path_in_container }},ro \
|
2020-11-24 09:15:12 +01:00
|
|
|
--mount type=bind,src={{ matrix_nginx_proxy_confd_path }},dst=/etc/nginx/conf.d,ro \
|
2020-11-26 08:55:26 +01:00
|
|
|
{% if matrix_ssl_retrieval_method != 'none' %}
|
2020-11-24 09:15:12 +01:00
|
|
|
--mount type=bind,src={{ matrix_ssl_config_dir_path }},dst={{ matrix_ssl_config_dir_path }},ro \
|
2020-11-26 08:55:26 +01:00
|
|
|
{% endif %}
|
2019-02-05 10:46:16 +01:00
|
|
|
{% for volume in matrix_nginx_proxy_container_additional_volumes %}
|
|
|
|
-v {{ volume.src }}:{{ volume.dst }}:{{ volume.options }} \
|
|
|
|
{% endfor %}
|
2019-04-30 16:35:18 +02:00
|
|
|
{% for arg in matrix_nginx_proxy_container_extra_arguments %}
|
|
|
|
{{ arg }} \
|
|
|
|
{% endfor %}
|
2018-11-01 07:46:47 +01:00
|
|
|
{{ matrix_nginx_proxy_docker_image }}
|
2019-01-29 17:52:02 +01:00
|
|
|
|
2022-01-10 10:51:57 +01:00
|
|
|
{% for network in matrix_nginx_proxy_container_additional_networks %}
|
2023-02-06 07:38:43 +01:00
|
|
|
ExecStartPre={{ devture_systemd_docker_base_host_command_docker }} network connect {{ network }} matrix-nginx-proxy
|
2022-01-10 10:51:57 +01:00
|
|
|
{% endfor %}
|
|
|
|
|
2023-02-06 07:38:43 +01:00
|
|
|
ExecStart={{ devture_systemd_docker_base_host_command_docker }} start --attach matrix-nginx-proxy
|
|
|
|
|
2023-12-06 10:52:23 +01:00
|
|
|
ExecStop=-{{ devture_systemd_docker_base_host_command_sh }} -c '{{ devture_systemd_docker_base_host_command_docker }} stop --time={{ devture_systemd_docker_base_container_stop_grace_time_seconds }} matrix-nginx-proxy 2>/dev/null || true'
|
2022-11-04 15:40:25 +01:00
|
|
|
ExecStop=-{{ devture_systemd_docker_base_host_command_sh }} -c '{{ devture_systemd_docker_base_host_command_docker }} rm matrix-nginx-proxy 2>/dev/null || true'
|
2022-11-04 15:39:35 +01:00
|
|
|
ExecReload={{ devture_systemd_docker_base_host_command_docker }} exec matrix-nginx-proxy /usr/sbin/nginx -s reload
|
2017-07-31 22:07:30 +02:00
|
|
|
Restart=always
|
|
|
|
RestartSec=30
|
2019-05-16 02:41:45 +02:00
|
|
|
SyslogIdentifier=matrix-nginx-proxy
|
2017-07-31 22:07:30 +02:00
|
|
|
|
|
|
|
[Install]
|
|
|
|
WantedBy=multi-user.target
|