Matrix Docker Ansible eploy
Non puoi selezionare più di 25 argomenti Gli argomenti devono iniziare con una lettera o un numero, possono includere trattini ('-') e possono essere lunghi fino a 35 caratteri.
 
 

46 righe
1.5 KiB

  1. [Unit]
  2. Description=Matrix Synapse server
  3. After=docker.service
  4. Requires=docker.service
  5. {% if not matrix_postgres_use_external %}
  6. Requires=matrix-postgres.service
  7. After=matrix-postgres.service
  8. {% endif %}
  9. {% if matrix_s3_media_store_enabled %}
  10. After=matrix-goofys.service
  11. Requires=matrix-goofys.service
  12. {% endif %}
  13. [Service]
  14. Type=simple
  15. ExecStartPre=-/usr/bin/docker kill matrix-synapse
  16. ExecStartPre=-/usr/bin/docker rm matrix-synapse
  17. {% if matrix_s3_media_store_enabled %}
  18. # Allow for some time before starting, so that media store can mount.
  19. # Mounting can happen later too, but if we start writing,
  20. # we'd write files to the local filesystem and fusermount will complain.
  21. ExecStartPre=/bin/sleep 5
  22. {% endif %}
  23. ExecStart=/usr/bin/docker run --rm --name matrix-synapse \
  24. {% if not matrix_postgres_use_external %}
  25. --link matrix-postgres:{{ matrix_postgres_connection_hostname }} \
  26. {% endif %}
  27. -p 8448:8448 \
  28. {% if not matrix_nginx_proxy_enabled %}
  29. -p 127.0.0.1:8008:8008 \
  30. {% endif %}
  31. -p 3478:3478 \
  32. -p 3478:3478/udp \
  33. -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 \
  34. -v {{ matrix_synapse_config_dir_path }}:/data \
  35. -v {{ matrix_synapse_run_path }}:/matrix-run \
  36. -v {{ matrix_synapse_storage_path }}:/matrix-storage:slave \
  37. {{ docker_matrix_image }}
  38. ExecStop=-/usr/bin/docker kill matrix-synapse
  39. ExecStop=-/usr/bin/docker rm matrix-synapse
  40. Restart=always
  41. RestartSec=30
  42. [Install]
  43. WantedBy=multi-user.target