Matrix Docker Ansible eploy
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 

40 lines
1.8 KiB

  1. #jinja2: lstrip_blocks: "True"
  2. [Unit]
  3. Description=Matrix Goofys media store
  4. After=docker.service
  5. Requires=docker.service
  6. DefaultDependencies=no
  7. [Service]
  8. Type=simple
  9. Environment="HOME={{ devture_systemd_docker_base_systemd_unit_home_path }}"
  10. ExecStartPre=-{{ devture_systemd_docker_base_host_command_docker }} kill %n
  11. ExecStartPre=-{{ devture_systemd_docker_base_host_command_docker }} rm %n
  12. ExecStart={{ devture_systemd_docker_base_host_command_docker }} run --rm --name %n \
  13. --log-driver=none \
  14. --user={{ matrix_synapse_uid }}:{{ matrix_synapse_gid }} \
  15. --mount type=bind,src=/etc/passwd,dst=/etc/passwd,ro \
  16. --mount type=bind,src=/etc/group,dst=/etc/group,ro \
  17. --mount type=bind,src={{ matrix_s3_media_store_path }},dst=/s3,bind-propagation=shared \
  18. --security-opt apparmor=unconfined \
  19. --cap-add mknod \
  20. --cap-add sys_admin \
  21. --device=/dev/fuse \
  22. --env-file={{ matrix_synapse_config_dir_path }}/env-goofys \
  23. --entrypoint /bin/sh \
  24. {{ matrix_s3_goofys_docker_image }} \
  25. -c 'goofys -f{% if not matrix_s3_media_store_custom_endpoint_enabled %} --storage-class=STANDARD_IA{% endif %}{% if matrix_s3_media_store_custom_endpoint_enabled %} --endpoint={{ matrix_s3_media_store_custom_endpoint }}{% endif %} --region {{ matrix_s3_media_store_region }} --stat-cache-ttl 60m0s --type-cache-ttl 60m0s --dir-mode 0700 --file-mode 0700 {{ matrix_s3_media_store_bucket_name }} /s3'
  26. TimeoutStartSec=5min
  27. ExecStop=-{{ devture_systemd_docker_base_host_command_docker }} stop %n
  28. ExecStop=-{{ devture_systemd_docker_base_host_command_docker }} kill %n
  29. ExecStop=-{{ devture_systemd_docker_base_host_command_docker }} rm %n
  30. ExecStop=-{{ matrix_host_command_fusermount }} -u {{ matrix_s3_media_store_path }}
  31. Restart=always
  32. RestartSec=5
  33. SyslogIdentifier=matrix-goofys
  34. [Install]
  35. WantedBy=multi-user.target