-
Notifications
You must be signed in to change notification settings - Fork 43
/
Copy pathsystemd.services
32 lines (30 loc) · 1.07 KB
/
systemd.services
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
# @see https://trstringer.com/simple-vs-oneshot-systemd-service/
[Unit]
Description=Docker Compose Application Service
After=docker.service
Requires=docker.service
[Service]
Type=oneshot
User=YOUR_USER
RestartSec=120
Restart=on-failure
TimeoutStopSec=60
TimeoutStartSec=300
RemainAfterExit=true
StandardOutput=journal+console
WorkingDirectory=/var/www/docker/
# ExecStartPre=/usr/local/bin/docker-compose pull --quiet --ignore-pull-failures
ExecStart=/usr/local/bin/docker-compose --compatibility up --force-recreate --no-build --no-deps --detach
# NOTE: The service fails and halts execution.
# But what if you didn’t want that failure to stop the service from continuing? You can simply add a - character in front of the executable.
ExecStart=-/usr/bin/make -f Makefile \
-f services/app/Makefile \
docker-up-app
ExecStart=-/usr/bin/make -f Makefile \
-f services/nginx/Makefile \
docker-up-webserver
ExecStart=/usr/bin/make docker-up context=traefik version=v0
ExecStop=/usr/bin/make docker-rmf
ExecStop=/usr/bin/make docker-prune
[Install]
WantedBy=multi-user.target