-
-
Save jbontech/55c6f16370982454f837df0b6fc53801 to your computer and use it in GitHub Desktop.
Docker Systemd Unit File
This file contains 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
[Unit] | |
Description=PostgreSQL container | |
Requires=docker.service | |
After=docker.service | |
[Service] | |
Restart=on-failure | |
RestartSec=10 | |
ExecStartPre=-/usr/bin/docker stop postgres | |
ExecStartPre=-/usr/bin/docker rm postgres | |
ExecStart=/usr/bin/docker run --name postgres \ | |
--volume /srv/db/postgres:/var/lib/pgsql/data \ | |
kiasaki/alpine-postgres | |
ExecStop=/usr/bin/docker stop postgres | |
[Install] | |
WantedBy=multi-user.target |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment