Skip to content

Instantly share code, notes, and snippets.

@deg0nz
Created October 30, 2020 15:20
Show Gist options
  • Save deg0nz/80c06e28c0906745490878e802158550 to your computer and use it in GitHub Desktop.
Save deg0nz/80c06e28c0906745490878e802158550 to your computer and use it in GitHub Desktop.
SystemD unit for Docker container Template
[Unit]
Description=organizr - HTPC/Homelab Services Organizer
After=docker.service
Requires=docker.service
[Service]
TimeoutStartSec=0
Restart=always
ExecStartPre=/usr/bin/docker pull organizr/organizr:latest
ExecStartPre=-/usr/bin/docker kill %p
ExecStartPre=-/usr/bin/docker rm %p
# GID and UID = www-data
ExecStart=/usr/bin/docker run --rm \
--name=%p \
-v /srv/organizr-v2:/config \
-e PGID=33 -e PUID=33 \
-e TZ=Europe/Berlin \
-e fpm=true \
-e branch=v2-master \
-p 127.0.0.1:8081:80 \
organizr/organizr
ExecStop=-/usr/bin/docker stop -t 10 %p
[Install]
WantedBy=multi-user.target
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment