Build your own PaaS with tsuru and Docker

This document describes how to create a private PaaS service using tsuru and docker.

This document assumes that tsuru is being installed on a Ubuntu 12.04 LTS 64-bit machine.

Before install

Before install, let’s install curl and python-software-properties, that are used to install extra repositories.

apt-get update
apt-get install curl -qqy

apt-get install python-software-properties -qqy

Adding repositories

curl | apt-key add -
echo "deb docker main" | sudo tee /etc/apt/sources.list.d/docker.list

apt-add-repository ppa:tsuru/lvm2 -y
apt-add-repository ppa:tsuru/ppa -y

apt-key adv --keyserver hkp:// --recv 7F0CEB10
echo "deb dist 10gen" | sudo tee /etc/apt/sources.list.d/mongodb.list

apt-get update

Installing mongo

apt-get install mongodb-10gen -qqy

Installing beanstalk

apt-get install beanstalkd -qqy
cat > /etc/default/beanstalkd <<EOF
service beanstalkd start

Installing redis

apt-get install redis-server -qqy

Installing hipache

apt-get install node-hipache -qqy
start hipache

Installing docker

apt-get install lxc-docker -qqy
sed -i.old -e 's;-d;-d -H tcp://;' /etc/init/docker.conf
rm /etc/init/docker.conf.old
stop docker
start docker

Installing gandalf

apt-get install gandalf-server -qqy
mkdir -p $hook_dir
curl -o ${hook_dir}/post-receive
chmod +x ${hook_dir}/post-receive
chown -R git:git /home/git/bare-template
cp /vagrant/gandalf.conf /etc/gandalf.conf
sed -i.old -e "s/{{{HOST_IP}}}/${host_ip}/" /etc/gandalf.conf

start gandalf-server
start git-daemon

Installing Tsuru api server

apt-get install tsuru-server -qqy

cp /vagrant/tsuru.conf /etc/tsuru/tsuru.conf
sed -i.old -e "s/{{{HOST_IP}}}/${host_ip}/" /etc/tsuru/tsuru.conf
sed -i.old -e 's/=no/=yes/' /etc/default/tsuru-server
rm /etc/default/tsuru-server.old /etc/tsuru/tsuru.conf.old
start tsuru-ssh-agent
start tsuru-server-api
start tsuru-server-collector

Installing platforms

curl -O
mongo tsuru platforms-setup.js
#git clone
#(cd basebuilder/python/ && docker -H build -t "tsuru/python" .)

Using tsuru

Congratulations! At this point you should have a working tsuru server running on your machine, follow the tsuru client usage guide to start build your apps.

Adding Services

Here you will find a complete step-by-step example of how to install a mysql service with tsuru:

DNS server

You can integrate any DNS server with tsuru. Here: you can find a example of how to install a DNS server integrated with tsuru