ansible/roles/element_web_docker/templates/element-web-docker.service.j2

24 lines
1.2 KiB
Django/Jinja

[Unit]
Description=Element Web with Docker
After=docker.service
Requires=docker.service
[Service]
ExecStartPre=-/usr/bin/docker rm --force {{ container_names.element_web.element_web }}
ExecStart=/usr/bin/docker run --rm --name {{ container_names.element_web.element_web }} \
--network traefik --env-file {{ docker_volumes_dir }}/element_web/element_web.env \
--label "traefik.enable=true" --label "traefik.http.routers.element.rule=Host(`chat.un-hack-bar.de`)" \
--label "traefik.http.routers.element.entrypoints=websecure" \
--label "traefik.http.routers.element.tls.certresolver=letsencrypt" \
--label "traefik.http.services.element.loadbalancer.server.port=80" \
--env-file {{ docker_volumes_dir }}/element_web/element_web.env \
-v {{ docker_volumes_dir }}/element_web/config/config.json:/app/config.json:ro \
-v {{ docker_volumes_dir }}/element_web/config/unhb.png:/app/unhb.png:ro \
vectorim/element-web:{{ version.element_web }}
ExecStop=-/usr/bin/docker stop {{ container_names.element_web.element_web }}
Restart=always
RestartSec=60s
Type=exec
[Install]
WantedBy=multi-user.target