2 ################################################
3 ### Managed by someone's ansible provisioner ###
4 ################################################
5 # Part of: https://git.somenet.org/root/pub/somesible.git
6 # 2017-2024 by someone <someone@somenet.org>
10 Description=Docker compose service %i
11 OnFailure=unit-status-mail@%n.service
12 Requires=docker.service
14 PartOf=docker-compose.target
15 ConditionPathIsDirectory=/etc/docker/compose-%i/
23 WorkingDirectory=/etc/docker/compose-%i/
24 ExecStartPre=/bin/bash -c 'source pre-exec-sourced.sh'
27 ExecStartPre=-/usr/bin/docker-compose pull
28 ExecStart=/usr/bin/docker-compose up --no-recreate --build
29 ExecStartPost=-/bin/bash -c '(sleep 600; docker system prune -af)&'
31 # Compose down, remove containers and volumes
32 ExecStop=/usr/bin/docker-compose down -v
34 # reloading cant be reliably used for checking for updates :(
35 #ExecReload=/usr/bin/docker-compose pull
36 #ExecReload=-/bin/bash -c '(sleep 600; docker system prune -af)&'
39 WantedBy=multi-user.target