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.
 
 

45 lines
1.4 KiB

  1. [Unit]
  2. Description=Matrix Coturn server
  3. {% for service in matrix_coturn_systemd_required_services_list %}
  4. Requires={{ service }}
  5. After={{ service }}
  6. {% endfor %}
  7. [Service]
  8. Type=simple
  9. ExecStartPre=-/usr/bin/docker kill matrix-coturn
  10. ExecStartPre=-/usr/bin/docker rm matrix-coturn
  11. ExecStart=/usr/bin/docker run --rm --name matrix-coturn \
  12. --log-driver=none \
  13. --user={{ matrix_user_uid }}:{{ matrix_user_gid }} \
  14. --cap-drop=ALL \
  15. --entrypoint=turnserver \
  16. --read-only \
  17. --tmpfs=/var/tmp:rw,noexec,nosuid,size=100m \
  18. --network={{ matrix_coturn_docker_network }} \
  19. -p 3478:3478 \
  20. -p 3478:3478/udp \
  21. -p 5349:5349 \
  22. -p 5349:5349/udp \
  23. -p {{ matrix_coturn_turn_udp_min_port }}-{{ matrix_coturn_turn_udp_max_port }}:{{ matrix_coturn_turn_udp_min_port }}-{{ matrix_coturn_turn_udp_max_port }}/udp \
  24. -v {{ matrix_coturn_config_path }}:/turnserver.conf:ro \
  25. {% for volume in matrix_coturn_container_additional_volumes %}
  26. -v {{ volume.src }}:{{ volume.dst }}:{{ volume.options }} \
  27. {% endfor %}
  28. {{ matrix_coturn_docker_image }} \
  29. -c /turnserver.conf
  30. ExecStop=-/usr/bin/docker kill matrix-coturn
  31. ExecStop=-/usr/bin/docker rm matrix-coturn
  32. # This only reloads certificates (not other configuration).
  33. # See: https://github.com/coturn/coturn/pull/236
  34. ExecReload=/usr/bin/docker exec matrix-coturn kill -USR2 1
  35. Restart=always
  36. RestartSec=30
  37. [Install]
  38. WantedBy=multi-user.target