24 lines
809 B
Desktop File
24 lines
809 B
Desktop File
[Unit]
|
|
Description=Mistborn Bitwarden Service
|
|
Requires=Mistborn-base.service
|
|
After=Mistborn-base.service
|
|
|
|
[Service]
|
|
Restart=always
|
|
User=root
|
|
Group=docker
|
|
PermissionsStartOnly=true
|
|
# Shutdown container (if running) when unit is stopped
|
|
ExecStartPre=/usr/local/bin/docker-compose -f /opt/mistborn/extra/bitwarden.yml down
|
|
|
|
ExecStartPre=/sbin/iptables -w -I DOCKER-USER -i DIFACE -p tcp --dport 3012 -j MISTBORN_LOG_DROP
|
|
# Start container when unit is started
|
|
ExecStart=/usr/local/bin/docker-compose -f /opt/mistborn/extra/bitwarden.yml up --build
|
|
# Stop container when unit is stopped
|
|
ExecStop=/usr/local/bin/docker-compose -f /opt/mistborn/extra/bitwarden.yml down
|
|
# Post stop
|
|
ExecStopPost=-/sbin/iptables -D DOCKER-USER -i DIFACE -p tcp --dport 3012 -j MISTBORN_LOG_DROP
|
|
|
|
[Install]
|
|
WantedBy=multi-user.target
|