ansible/roles/pretix_docker/templates/pretix.service.j2

28 lines
1.2 KiB
Text
Raw Permalink Normal View History

[Unit]
Description=Pretix with Docker
After=docker.service
Requires=docker.service
2023-09-04 16:47:31 +02:00
Requires=pretix-db.service
Requires=pretix-redis.service
[Service]
ExecStartPre=-/usr/bin/docker rm --force {{ pretix_container_name }}
ExecStart=/usr/bin/docker run --rm --name {{ pretix_container_name }} --network pretix \
--label com.centurylinklabs.watchtower.enable=false --env-file {{ docker_volumes_dir }}/pretix/pretix.env \
-v {{ docker_volumes_dir }}/pretix/data:/data \
-v {{ docker_volumes_dir }}/pretix/conf:/etc/pretix \
2024-07-16 21:57:13 +02:00
--label "traefik.enable=true" --label "traefik.http.routers.pretix.rule=Host(`pretix.un-hack-bar.de`)" \
--label "traefik.http.routers.pretix.entrypoints=websecure" \
--label "traefik.http.routers.pretix.tls.certresolver=letsencrypt" \
--label "traefik.http.services.pretix.loadbalancer.server.port=80" \
--label "traefik.docker.network=traefik" \
pretix/standalone:stable
2024-07-16 21:57:13 +02:00
ExecStartPost=/usr/bin/bash -c "/bin/sleep 10 && /usr/bin/docker network connect traefik {{ pretix_container_name }}"
ExecStop=/usr/bin/docker stop {{ pretix_container_name }}
Restart=always
RestartSec=15s
2023-09-04 16:47:31 +02:00
Type=exec
[Install]
WantedBy=multi-user.target