]> git.somenet.org - root/pub/somesible.git/blob - roles/server/docker-compose/files/default/docker-compose@.service
roles/server/nginx/vhost-unified
[root/pub/somesible.git] / roles / server / docker-compose / files / default / docker-compose@.service
1 #
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>
7 #
8
9 [Unit]
10 Description=Docker compose service %i
11 OnFailure=unit-status-mail@%n.service
12 Requires=docker.service
13 After=network.target
14 PartOf=docker-compose.target
15 ConditionPathIsDirectory=/etc/docker/compose-%i/
16
17
18 [Service]
19 Type=simple
20 TimeoutSec=1800
21 Restart=on-failure
22 RestartSec=15
23 WorkingDirectory=/etc/docker/compose-%i/
24 ExecStartPre=/bin/bash -c 'source pre-exec-sourced.sh'
25
26 # Compose up
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)&'
30
31 # Compose down, remove containers and volumes
32 ExecStop=/usr/bin/docker-compose down -v
33
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)&'
37
38 [Install]
39 WantedBy=multi-user.target