From bc27727dcce2aedc1d73fbc7893b53206af6de70 Mon Sep 17 00:00:00 2001
From: Michiel de Jong <michiel@unhosted.org>
Date: Wed, 3 Dec 2014 18:00:54 +0100
Subject: [PATCH] using just Docker and bash

---
 doc/deploying-a-server.md         |  2 +-
 doc/running-on-ubuntu.md          | 45 -------------------------------
 doc/using-just-docker-and-bash.md | 36 +++++++++++++++++++++++++
 3 files changed, 37 insertions(+), 46 deletions(-)
 delete mode 100644 doc/running-on-ubuntu.md
 create mode 100644 doc/using-just-docker-and-bash.md

diff --git a/doc/deploying-a-server.md b/doc/deploying-a-server.md
index a83734f..18ba6c8 100644
--- a/doc/deploying-a-server.md
+++ b/doc/deploying-a-server.md
@@ -5,7 +5,7 @@ Make sure you read [getting started](getting-started-as-a-hoster.md) first.
 
 ### Prepare your orchestration data
 * Get a CoreOS server, for instance from [RackSpace](rackspace.com), [Vultr](vultr.com), or [Hetzner](http://serverboerse.de/).
-* We aim to also support Ubuntu 14.10, but this is currently blocked by issue [#44](https://github.com/indiehosters/indiehosters/issues/44)
+* If you prefer another operating system, you can also run our Docker images [using just Docker and bash](using-just-docker-and-bash.md).
 * If you didn't add your public ssh key during the order process (e.g. through your IaaS control panel or a cloud-config file),
   scp your laptop's public ssh key (probably in `~/.ssh/id_rsa.pub`) to `.ssh/authorized_keys` for the remote user
   you will be ssh-ing and scp-ing as (the default remote user of our deploy scripts is 'core').
diff --git a/doc/running-on-ubuntu.md b/doc/running-on-ubuntu.md
deleted file mode 100644
index 8a7b853..0000000
--- a/doc/running-on-ubuntu.md
+++ /dev/null
@@ -1,45 +0,0 @@
-# Work in progress
-
-
-
-
-We try to support ubuntu 14.10, but this is blocked by [#44](https://github.com/indiehosters/indiehosters/issues/44)
-
-
-
-
-
-To run an IndieHosters on ubuntu 14.10 (earlier versions will not work), run something like:
-
-````bash
-apt-get update && apt-get -y upgrade && apt-get -y dist-upgrade
-dpkg-reconfigure -plow unattended-upgrades
-# set unattended upgrades to 'Yes'
-apt-get -y install systemd-sysv git docker.io
-printf '#!/bin/sh\ndocker run --net=host quay.io/coreos/etcd:v0.4.6 /etcdctl $1 $2 $3 $4' > /usr/local/bin/etcdctl
-chmod u+x /usr/local/bin/etcdctl
-printf "[Unit]\nRequires=docker.service\nAfter=docker.service\n[Service]\nRestart=always\n\
-ExecStartPre=-/usr/bin/docker kill etcd\n\
-ExecStartPre=-/usr/bin/docker rm etcd\n\
-ExecStart=/usr/bin/docker run \
-  --name etcd \
-  -p 127.0.0.1:4001:4001 \
-  quay.io/coreos/etcd:v0.4.6\n\
-ExecReload=/usr/bin/docker restart etcd\n\
-ExecStop=/usr/bin/docker stop etcd\n\
-[Install]\n\
-WantedBy=multi-user.target\n" > /etc/systemd/system/etcd.service
-shutdown -r now
-````
-
-````
-systemctl enable etcd
-systemctl start etcd
-systemctl list-units
-docker ps
-etcdctl ls
-etcdctl help
-````
-
-Now follow the [CoreOS-based instructions](deploying-a-server.md)
-
diff --git a/doc/using-just-docker-and-bash.md b/doc/using-just-docker-and-bash.md
new file mode 100644
index 0000000..5786f5f
--- /dev/null
+++ b/doc/using-just-docker-and-bash.md
@@ -0,0 +1,36 @@
+# Using just Docker and bash
+
+## WARNING: Still a work-in-process
+
+Given that CoreOS is not available everywhere, and the Ubuntu 14.10 setup with etcdctl inside a Docker instance still has some problems,
+I'll try if I can run all our services (postfix-forwarder, haproxy, and the various web backend containers) on an off-the-shelf Ubuntu 14.04 server. Here's what I did to prepare the server:
+
+````bash
+apt-get update && apt-get -y upgrade && apt-get -y dist-upgrade
+apt-get -y install unattended-upgrades
+dpkg-reconfigure -plow unattended-upgrades
+# set unattended upgrades to 'Yes'
+apt-get -y install docker.io
+ssh-keygen -t rsa
+````
+
+Then I added the .ssh/id_rsa.pub to .ssh/authorized_keys at both backup server accounts, and ran:
+
+````
+mkdir -p /data
+cd /data
+git clone git@bu25:postfix
+git clone git@bu25:haproxy
+docker run -d -v /data/haproxy:/etc/haproxy -p 80:80 -p 443:443 indiehosters/haproxy
+docker run -d --name postfix-forwarder -v /data/postfix:/data -p 25:25 indiehosters/postfix-forwarder 
+````
+
+And then for each domain I host:
+
+````
+cd /data
+git clone git@bu25:michielbdejong.com
+docker run -d --name michielbdejong.com -v /data/michielbdejong.com:/data indiehosters/lamp-git
+````
+
+Now the only thing you need to do is to get each backend IP address from `docker inspect michielbdejong.com` and edit `/data/runtime/haproxy/haproxy.cfg` with the correct IP address.
-- 
GitLab