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.
 
 

35 lines
1.2 KiB

  1. [Unit]
  2. Description=Matrix Synapse server
  3. After=docker.service
  4. Requires=docker.service
  5. Requires=matrix-postgres.service
  6. After=matrix-postgres.service
  7. {% if matrix_s3_media_store_enabled %}
  8. After=matrix-s3fs.service
  9. Requires=matrix-s3fs.service
  10. {% endif %}
  11. [Service]
  12. Type=simple
  13. ExecStartPre=-/usr/bin/docker kill matrix-synapse
  14. ExecStartPre=-/usr/bin/docker rm matrix-synapse
  15. ExecStartPre=-/usr/bin/chown {{ matrix_user_username }}:{{ matrix_user_username }} {{ ssl_certs_path }} -R
  16. ExecStart=/usr/bin/docker run --rm --name matrix-synapse \
  17. --link matrix-postgres:postgres \
  18. -p 8448:8448 \
  19. -p 3478:3478 \
  20. -p 3478:3478/udp \
  21. -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 \
  22. -v {{ matrix_synapse_config_dir_path }}:/data \
  23. -v {{ matrix_synapse_run_path }}:/matrix-run \
  24. -v {{ matrix_synapse_media_store_path }}:/matrix-media-store \
  25. -v {{ ssl_certs_path }}:/acmetool-certs \
  26. {{ docker_matrix_image }}
  27. ExecStop=-/usr/bin/docker kill matrix-synapse
  28. ExecStop=-/usr/bin/docker rm matrix-synapse
  29. Restart=always
  30. RestartSec=30
  31. [Install]
  32. WantedBy=multi-user.target