From 7c8723fb22d0b5e8ac7a863e7a85e2995bbc64ee Mon Sep 17 00:00:00 2001 From: Kai Hendry Date: Mon, 20 Oct 2014 06:08:11 +0000 Subject: [PATCH] Service file to spin up Docker container --- README.md | 8 ++++---- greptweet.service | 15 +++++++++++++++ 2 files changed, 19 insertions(+), 4 deletions(-) create mode 100644 greptweet.service diff --git a/README.md b/README.md index 63c950f..3254a18 100644 --- a/README.md +++ b/README.md @@ -49,13 +49,13 @@ Save that SECRETEXAMPLESTRING to secret.php: $bearer_token = 'SECRETEXAMPLESTRING'; ?> -# nginx configuration - -See - # Daily backup @daily cd /srv/www/greptweet.com && git describe --always > version.txt @daily find /srv/www/greptweet.com/u/ -name '*.gz' -type f -print0 | tar cf /srv/www/backup.greptweet.com/tweets.tar --null -T - + +# Setting up the hosting environment + + diff --git a/greptweet.service b/greptweet.service new file mode 100644 index 0000000..1b92f7a --- /dev/null +++ b/greptweet.service @@ -0,0 +1,15 @@ +[Unit] +# https://docs.docker.com/articles/host_integration/ +# https://coreos.com/docs/launching-containers/launching/getting-started-with-systemd/ +Description=Greptweet +After=docker.service +Requires=docker.service + +[Service] +TimeoutStartSec=0 +ExecStartPre=-/usr/bin/docker kill greptweet1 +ExecStartPre=-/usr/bin/docker rm greptweet1 +ExecStart=/usr/bin/docker run --name greptweet1 -v /srv/www/greptweet.com:/srv/http/u -p 80:80 greptweet + +[Install] +WantedBy=multi-user.target