Files
dokku/bootstrap.sh
Jeff Lindsay dab5b7911b Merge pull request #41 from rnorth/auto_restart
Making docker automatically restart previously running containers
2013-06-22 11:01:45 -07:00

37 lines
1.3 KiB
Bash

DOKKU_REPO=${DOKKU_REPO:-"https://github.com/progrium/dokku.git"}
DOKKU_STACK=${DOKKU_STACK:-"https://s3.amazonaws.com/progrium-dokku/progrium_buildstep.tgz"}
DOCKER_PKG=${DOCKER_PKG:-"https://launchpad.net/~dotcloud/+archive/lxc-docker/+files/lxc-docker_0.4.2-1_amd64.deb"}
apt-get update
apt-get install -y linux-image-extra-`uname -r`
apt-get install -y python-software-properties
apt-get install -y git nginx make curl dnsutils
cd /tmp
wget "$DOCKER_PKG"
dpkg -i lxc-docker_0.4.2-1_amd64.deb
apt-get install -f -y
rm lxc-docker_0.4.2-1_amd64.deb
sed -i.bak 's/docker -d/docker -d -r=true/' /etc/init/docker.conf # Docker should restart containers
cd ~ && git clone ${DOKKU_REPO}
cd dokku && make install
if [[ $DOKKU_STACK ]]; then
curl "$DOKKU_STACK" | gunzip -cd | docker import - progrium/buildstep
else
cd buildstep && make build
fi
[[ -f /etc/nginx/nginx.conf ]] && sed -i 's/# server_names_hash_bucket_size/server_names_hash_bucket_size/' /etc/nginx/nginx.conf
/etc/init.d/nginx start
start nginx-reloader
[[ $(dig +short $HOSTNAME) ]] && HOSTFILE=DOMAIN || HOSTFILE=HOSTNAME
echo $HOSTNAME > /home/git/$HOSTFILE
echo
echo "Be sure to upload a public key for your user:"
echo " cat ~/.ssh/id_rsa.pub | ssh root@$HOSTNAME \"gitreceive upload-key progrium\""