mirror of
https://github.com/spantaleev/matrix-docker-ansible-deploy.git
synced 2024-11-10 20:57:41 +01:00
34 lines
1.1 KiB
Django/Jinja
34 lines
1.1 KiB
Django/Jinja
[Unit]
|
|
Description=Matrix Mautrix Telegram server
|
|
After=docker.service
|
|
Requires=docker.service
|
|
Requires=matrix-synapse.service
|
|
After=matrix-synapse.service
|
|
|
|
[Service]
|
|
Type=simple
|
|
ExecStartPre=-/usr/bin/docker kill matrix-mautrix-telegram
|
|
ExecStartPre=-/usr/bin/docker rm matrix-mautrix-telegram
|
|
ExecStartPre=/usr/bin/docker run --rm --name matrix-mautrix-telegram-db \
|
|
--log-driver=none \
|
|
--user={{ matrix_user_uid }}:{{ matrix_user_gid }} \
|
|
--cap-drop=ALL \
|
|
-v {{ matrix_mautrix_telegram_base_path }}:/data:z \
|
|
{{ matrix_mautrix_telegram_docker_image }} \
|
|
alembic -x config=/data/config.yaml upgrade head
|
|
ExecStart=/usr/bin/docker run --rm --name matrix-mautrix-telegram \
|
|
--log-driver=none \
|
|
--user={{ matrix_user_uid }}:{{ matrix_user_gid }} \
|
|
--cap-drop=ALL \
|
|
--network={{ matrix_docker_network }} \
|
|
-v {{ matrix_mautrix_telegram_base_path }}:/data:z \
|
|
{{ matrix_mautrix_telegram_docker_image }} \
|
|
python3 -m mautrix_telegram -c /data/config.yaml
|
|
ExecStop=-/usr/bin/docker kill matrix-mautrix-telegram
|
|
ExecStop=-/usr/bin/docker rm matrix-mautrix-telegram
|
|
Restart=always
|
|
RestartSec=30
|
|
|
|
[Install]
|
|
WantedBy=multi-user.target
|