Add matrix-cactus-comments-client role
This is split out from matrix-cactus-comments (see 241779b583
),
but also heavily inspired by `matrix-static-files`.
This commit is contained in:
@ -0,0 +1,6 @@
|
||||
SERVER_PORT={{ matrix_cactus_comments_client_environment_variable_server_port }}
|
||||
|
||||
SERVER_LOG_LEVEL={{ matrix_cactus_comments_client_environment_variable_server_log_level }}
|
||||
SERVER_LOG_REMOTE_ADDRESS={{ 'true' if matrix_cactus_comments_client_environment_variable_server_log_remote_address else 'false' }}
|
||||
|
||||
{{ matrix_cactus_comments_client_environment_variables_additional_variables }}
|
@ -0,0 +1,47 @@
|
||||
{% if matrix_cactus_comments_client_container_labels_traefik_enabled %}
|
||||
traefik.enable=true
|
||||
|
||||
{% if matrix_cactus_comments_client_container_labels_traefik_docker_network %}
|
||||
traefik.docker.network={{ matrix_cactus_comments_client_container_labels_traefik_docker_network }}
|
||||
{% endif %}
|
||||
|
||||
traefik.http.services.matrix-cactus-comments-client.loadbalancer.server.port={{ matrix_cactus_comments_client_environment_variable_server_port }}
|
||||
|
||||
{#
|
||||
Public
|
||||
#}
|
||||
{% if matrix_cactus_comments_client_container_labels_public_enabled %}
|
||||
|
||||
{% set public_middlewares = [] %}
|
||||
|
||||
{% if matrix_cactus_comments_client_container_labels_public_traefik_path_prefix != '/' %}
|
||||
{% set public_middlewares = public_middlewares + ['matrix-cactus-comments-client-strip-prefix'] %}
|
||||
traefik.http.middlewares.matrix-cactus-comments-client-strip-prefix.stripprefix.prefixes={{ matrix_cactus_comments_client_container_labels_public_traefik_path_prefix }}
|
||||
{% endif %}
|
||||
|
||||
traefik.http.routers.matrix-cactus-comments-client-base-domain.rule={{ matrix_cactus_comments_client_container_labels_public_traefik_rule }}
|
||||
|
||||
{% if matrix_cactus_comments_client_container_labels_public_traefik_priority | int > 0 %}
|
||||
traefik.http.routers.matrix-cactus-comments-client-base-domain.priority={{ matrix_cactus_comments_client_container_labels_public_traefik_priority }}
|
||||
{% endif %}
|
||||
|
||||
{% if public_middlewares | length > 0 %}
|
||||
traefik.http.routers.matrix-cactus-comments-client-base-domain.middlewares={{ public_middlewares | join(',') }}
|
||||
{% endif %}
|
||||
|
||||
traefik.http.routers.matrix-cactus-comments-client-base-domain.service=matrix-cactus-comments-client
|
||||
traefik.http.routers.matrix-cactus-comments-client-base-domain.entrypoints={{ matrix_cactus_comments_client_container_labels_public_traefik_entrypoints }}
|
||||
|
||||
traefik.http.routers.matrix-cactus-comments-client-base-domain.tls={{ matrix_cactus_comments_client_container_labels_public_traefik_tls | to_json }}
|
||||
{% if matrix_cactus_comments_client_container_labels_public_traefik_tls %}
|
||||
traefik.http.routers.matrix-cactus-comments-client-base-domain.tls.certResolver={{ matrix_cactus_comments_client_container_labels_public_traefik_tls_certResolver }}
|
||||
{% endif %}
|
||||
|
||||
{% endif %}
|
||||
{#
|
||||
/Public
|
||||
#}
|
||||
|
||||
{% endif %}
|
||||
|
||||
{{ matrix_cactus_comments_client_container_labels_additional_labels }}
|
@ -0,0 +1,48 @@
|
||||
#jinja2: lstrip_blocks: "True"
|
||||
[Unit]
|
||||
Description=matrix-cactus-comments-client server
|
||||
{% for service in matrix_cactus_comments_client_systemd_required_services_list %}
|
||||
Requires={{ service }}
|
||||
After={{ service }}
|
||||
{% endfor %}
|
||||
{% for service in matrix_cactus_comments_client_systemd_wanted_services_list %}
|
||||
Wants={{ service }}
|
||||
{% endfor %}
|
||||
DefaultDependencies=no
|
||||
|
||||
[Service]
|
||||
Type=simple
|
||||
Environment="HOME={{ devture_systemd_docker_base_systemd_unit_home_path }}"
|
||||
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-cactus-comments-client 2>/dev/null || true'
|
||||
ExecStartPre=-{{ devture_systemd_docker_base_host_command_sh }} -c '{{ devture_systemd_docker_base_host_command_docker }} rm matrix-cactus-comments-client 2>/dev/null || true'
|
||||
|
||||
ExecStartPre={{ devture_systemd_docker_base_host_command_docker }} create \
|
||||
--rm \
|
||||
--name=matrix-cactus-comments-client \
|
||||
--log-driver=none \
|
||||
--user={{ matrix_user_uid }}:{{ matrix_user_gid }} \
|
||||
--cap-drop=ALL \
|
||||
--read-only \
|
||||
--network={{ matrix_cactus_comments_client_container_network }} \
|
||||
{% if matrix_cactus_comments_client_container_http_host_bind_port %}
|
||||
-p {{ matrix_cactus_comments_client_container_http_host_bind_port }}:{{ matrix_cactus_comments_client_environment_variable_server_port }} \
|
||||
{% endif %}
|
||||
--env-file={{ matrix_cactus_comments_client_base_path }}/env \
|
||||
--label-file={{ matrix_cactus_comments_client_base_path }}/labels \
|
||||
--mount type=bind,src={{ matrix_cactus_comments_client_public_path }},dst=/public,ro \
|
||||
{{ matrix_cactus_comments_client_container_image }}
|
||||
|
||||
{% for network in matrix_cactus_comments_client_container_additional_networks %}
|
||||
ExecStartPre={{ devture_systemd_docker_base_host_command_docker }} network connect {{ network }} matrix-cactus-comments-client
|
||||
{% endfor %}
|
||||
|
||||
ExecStart={{ devture_systemd_docker_base_host_command_docker }} start --attach matrix-cactus-comments-client
|
||||
|
||||
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-cactus-comments-client 2>/dev/null || true'
|
||||
ExecStop=-{{ devture_systemd_docker_base_host_command_sh }} -c '{{ devture_systemd_docker_base_host_command_docker }} rm matrix-cactus-comments-client 2>/dev/null || true'
|
||||
Restart=always
|
||||
RestartSec=30
|
||||
SyslogIdentifier=matrix-cactus-comments-client
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
Reference in New Issue
Block a user