Last active
December 15, 2018 07:51
-
-
Save d9k/678a4ed3ceff4180c9fe6ebd65665db4 to your computer and use it in GitHub Desktop.
/etc/systemd/system/pgadmin4.service
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# thx https://karlstoney.com/2017/03/03/docker-containers-as-systemd-services/ | |
[Unit] | |
Description=Docker pgadmin4 | |
Requires=docker.service | |
After=docker.service | |
[Service] | |
#Restart=always | |
ExecStartPre=/bin/bash -c "/usr/bin/docker rm -f pgadmin4 || true" | |
ExecStart=/usr/bin/docker run --name pgadmin4 --restart=always -p 5050:5050 -v /home/d9k/soft/pgadmin4/data_pgadmin:/pgadmin thajeztah/pgadmin4 | |
#ExecStart=/usr/bin/docker run --name pgadmin4 --restart=always -p 5050:5050 -v /home/d9k/soft/pgadmin4/data_pgadmin:/pgadmin thajeztah/pgadmin4 | |
# ExecStart=/usr/bin/docker run --name pgadmin4 --restart=always -p 5050:5050 -v /home/d9k/soft/pgadmin4/data_pgadmin:/pgadmin thajeztah/pgadmin4 &>> /home/d9k/soft/pgadmin4/pgadmin4.log | |
# ExecStart=/usr/bin/docker run --name pgadmin4 --restart=always -p 5050:5050 -v /home/d9k/soft/pgadmin4/data_pgadmin:/pgadmin thajeztah/pgadmin4 &>> /home/d9k/soft/pgadmin4/pgadmin4.log & | |
# ExecStart=/usr/bin/docker run --name pgadmin4 --rm --restart=always -p 5050:5050 -v /home/d9k/soft/pgadmin4/data_pgadmin:/pgadmin thajeztah/pgadmin4 &>> /home/d9k/soft/pgadmin4/pgadmin4.log & | |
#ExecStart=/usr/bin/sudo -u d9k /usr/bin/docker start --name pgadmin4 --rm -p 5050:5050 -v /home/d9k/soft/pgadmin4/data_pgadmin:/pgadmin thajeztah/pgadmin4 | |
# &>> /home/d9k/soft/pgadmin4/pgadmin4.log | |
ExecStop=/usr/bin/docker stop -t 2 pgadmin4 | |
ExecStopPost=/usr/bin/docker rm -f pgadmin4 | |
[Install] | |
WantedBy=multi-user.target |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment