Skip to content

Instantly share code, notes, and snippets.

@bytesandwich
Created February 6, 2015 05:44
Show Gist options
  • Save bytesandwich/3ff7c1bca6d4b652ef8c to your computer and use it in GitHub Desktop.
Save bytesandwich/3ff7c1bca6d4b652ef8c to your computer and use it in GitHub Desktop.
postgres-master.service
[Unit]
Description=Postgres Master
After=docker.service
Requires=docker.service
[Service]
TimeoutStartSec=0
ExecStartPre=-/usr/bin/docker kill postgres-master
ExecStartPre=-/usr/bin/docker rm postgres-master
ExecStartPre=/usr/bin/docker pull postgres:9
ExecStart=/usr/bin/docker run -p 5432:5432 -rm --name postgres-master -e POSTGRES_PASSWORD=mysecretpassword postgres:9
ExecStop=/usr/bin/docker stop postgres-master
[X-Fleet]
Conflicts=postgres-replica@*.service
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment