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.
 
 

39 lines
1.3 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-s3fs.service
  11. Requires=matrix-s3fs.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. ExecStartPre=-/usr/bin/chown {{ matrix_user_username }}:{{ matrix_user_username }} {{ ssl_certs_path }} -R
  18. ExecStart=/usr/bin/docker run --rm --name matrix-synapse \
  19. {% if not matrix_postgres_use_external %}
  20. --link matrix-postgres:{{ matrix_postgres_connection_hostname }} \
  21. {% endif %}
  22. -p 8448:8448 \
  23. -p 3478:3478 \
  24. -p 3478:3478/udp \
  25. -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 \
  26. -v {{ matrix_synapse_config_dir_path }}:/data \
  27. -v {{ matrix_synapse_run_path }}:/matrix-run \
  28. -v {{ matrix_synapse_media_store_path }}:/matrix-media-store \
  29. -v {{ ssl_certs_path }}:/acmetool-certs \
  30. {{ docker_matrix_image }}
  31. ExecStop=-/usr/bin/docker kill matrix-synapse
  32. ExecStop=-/usr/bin/docker rm matrix-synapse
  33. Restart=always
  34. RestartSec=30
  35. [Install]
  36. WantedBy=multi-user.target