Kobo Docker Setup

Step by step how-to instructions on installing and running KoBo Toolbox on a standalone server.
Revision as of 19:10, 21 October 2016 by Vladimir (talk | contribs) (Created page with "<pre> curl -L https://github.com/docker/compose/releases/download/1.7.0/docker-compose-`uname -s`-`uname -m` > /usr/local/bin/docker-compose chmod +x /usr/local/bin/docker-com...")

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search
curl -L https://github.com/docker/compose/releases/download/1.7.0/docker-compose-`uname -s`-`uname -m` > /usr/local/bin/docker-compose
chmod +x /usr/local/bin/docker-compose
visudo
./wait_for_postgres.bash
docker-compose up -d
sudo apt-get update
sudo apt-get install git
sudo apt-get remove --purge resolvconf && sudo apt-get install --reinstall resolvconf
sudo apt-get install --reinstall resolvconf
sudo ethtool eth0
vi /etc/resolvconf/resolv.conf.d/base
sudo apt-get install --reinstall resolvconf
sudo vi /etc/resolv.conf 
git clone https://github.com/kobotoolbox/kobo-docker.git
cd kobo-docker/
ln -s docker-compose.server.yml docker-compose.yml
sudo docker-compose pull
sudo apt-get install docker-engine
uname -r
sudo apt-get install apt-transport-https ca-certificates
sudo apt-key adv --keyserver hkp://p80.pool.sks-keyservers.net:80 --recv-keys 58118E89F3A912897C070ADBF76221572C52609D
sudo vi /etc/apt/sources.list.d/docker.list
sudo apt-get purge lxc-docker
sudo apt-get install linux-image-extra-$(uname -r)
apt-get install apparmor
sudo apt-get install apparmor
sudo apt-get install docker-engine
sudo service docker start
sudo docker run hello-world
docker-compose pull
sudo apt-get install docker-compose
sudo curl -L https://github.com/docker/compose/releases/download/1.7.0/docker-compose-`uname -s`-`uname -m` > /usr/local/bin/docker-compose
docker-compose --version
sudo docker-compose pull
docker-compose build
vi envfile.server.txt
mkdir secrets
cd secrets/
vi ssl.crt
vi ssl.key
sudo docker-compose stop; sudo docker-compose rm
sudo rm -rf .vols/ log/.
sudo docker-compose up -d
sudo docker ps
cd kobo-docker/
vi docker-compose.yml
vi envfile.server.txt
less envfile.server.txt 
sudo docker-compose up -d
sudo docker ps
sudo docker-compose down
sudo docker-compose up -d
sudo docker ps
sudo docker-compose stop nginx && sudo docker-compose up -d && sudo docker-compose logs nginx

cd kobo-docker/
git fetch
git stash
git pull
git stash pop
vim envfile.server.txt 
docker-compose pull
cat /etc/group
cd kobo-docker/
docker-compose pull
docker exec -it kobodocker_nginx_1 bash
tail -f log/nginx/access.log
tail -f log/nginx/kobocat.access.log
tail -f log/nginx/kpi.access.log
tail -f log/nginx/kpi.error.log 
less log/nginx/kobocat.access.log
su esmail -c 'sudo du -h -d 1 .vols'
docker-compose logs -f
docker-compose up -d && docker-compose logs -f
sudo ls backups/postgres/
git fetch
git stash
git status
git add envfile.server.txt
git status
git reset HEAD envfile.server.txt
docker-compose stop
vim base_images/postgres/init_postgres.bash 
docker ps -a
mkdir postgres
cd postgres
docker export kobodocker_postgres_1 | tar x 
cd ..
rm -rf postgres/
mkdir postgres
docker export kobodocker_postgres_1 | tar x /srv
cd postgres
docker export kobodocker_postgres_1 | tar x /srv
docker export kobodocker_postgres_1 | tar x srv
cd srv/
du -h -d 1 
docker export kobodocker_postgres_1 | tar x srv
du -h -d 1
mkdir postgres && cd postgres
docker export kobodocker_postgres_1 | tar x srv
vim base_images/postgres/init_postgres.bash 
docker-compose up -d && docker-compose logs -f
docker-compose stop kpi
docker-compose rm -fv kpi
docker-compose up -d && docker-compose logs -f
cd base_images/
cd base
docker build -t kobotoolbox/base:latest .
cd ../base-kobos/
docker build -t kobotoolbox/base-koobos:latest .
#docker build -t kobotoolbox/base-kobos:latest .
git pull
git stash
git pull
git stash pop
git status
git reset HEAD ../postgres/init_postgres.bash
git status
git checkout -- ../postgres/init_postgres.bash
git status
git merge --continue
git status
git reset HEAD ../../envfile.server.txt
git status
docker build -t kobotoolbox/base-kobos:latest .
docker-compose pull
docker pull koboform_base
docker pull kobotoolbox/koboform_base
docker-compose pull
docker-compose up -d && docker-compose logs
docker-compose up -d && docker-compose logs -f
cd kobo-docker/
docker-compose pull
docker-compose up -d && docker-compose logs -f
docker exec -it kobodocker_kobocat_1 rm -rf /etc/service/wsgi
docker-compose logs -f kobocat
docker-compose restart kobocat && docker-compose logs -f kobocat
sudo top
docker-compose logs -f
cd kobo-docker/
vim docker-compose.yml 
vim envfiles/smtp.txt 
git stash -l
git stash lsit
git stash list

git stash list
git stash show -p stash@{1}
vim envfiles/aws.txt 
vim envfiles/smtp.txt 
vim envfile.server.txt 
vim docker-compose.yml 
ifconfig | grep docker
vim docker-compose.yml 
git diff
docker-compose up -d && docker exec -it kobodocker_kobocat_1 rm -rf /etc/service/wsgi && docker-compose logs -f
docker-compose up -d --remove-orphans && docker exec -it kobodocker_kobocat_1 rm -rf /etc/service/wsgi && docker-compose logs -f
docker-compose up -d && docker exec -it kobodocker_kobocat_1 rm -rf /etc/service/wsgi && docker-compose logs -f
docker-compose logs -f
docker ps
docker rm 971d080c505b
docker rm 53ed0ff8e8fc
docker exec -it 53ed0ff8e8fc bash
docker rm -f 53ed0ff8e8fc
bg
vim envfile.server.txt 
vim envfiles/smtp.txt 
vim envfiles/aws.txt 
cd kobo-docker/
docker-compose up
ssh ate@192.168.50.118
telnet 192.168.50.119 22
ssh 192.168.50.118
cd kobo-docker/
ssh root@192.168.50.118
cd kobo-docker/
more envfile.server.txt 
more envfile.local.txt 
cd envfiles
cat kobocat.txt 
cd kobo-docker/
cd postgres/
cd srv
cd kobo-docker/scripts/
./wait_for_kpi.bash 
./wait_for_postgres.bash 
sudo service docker status
sudo service docker restart
sudo ./wait_for_postgres.bash 
docker logs b98aa6bfaa6b
git clone https://github.com/kobotoolbox/kpi.git
docker pull kobotoolbox/koboform_base:latest
cd kpi
git checkout origin/master
docker build .
docker build -t kobotoolbox/kpi:latest .
sudo chmod --reference .vols/db postgres/srv/db_9.3
sudo chown --reference .vols/db postgres/srv/db_9.3
docker-compose run --rm postgres
docker-compose run --rm postgres bash
sudo mv postgres/srv/db_9.3 .vols/db
docker-compose run --rm postgres
sudo rm -rf postgres/
vim base_images/postgres/init_postgres.bash 
sudo chown --reference .vols/db postgres/srv/db_9.3
sudo chmod --reference .vols/db postgres/srv/db_9.3
sudo rm -rf .vols/db
sudo mv postgres/srv/db_9.3 .vols/db
docker-compose run --rm postgres
docker-compose run --rm postgres bash
sudo -c 'rm -rf postgres && mkdir postgres && cd postgres && docker export kobodocker_postgres_1 | tar x srv/db_9.3 && chmod --reference ../.vols/db srv/db_9.3 && chown --reference ../.vols/db srv/db_9.3'
sudo bash -c 'rm -rf postgres && mkdir postgres && cd postgres && docker export kobodocker_postgres_1 | tar x srv/db_9.3 && chmod --reference ../.vols/db srv/db_9.3 && chown --reference ../.vols/db srv/db_9.3'
sudo bash -c 'rm -rf postgres && mkdir postgres && cd postgres && docker export kobodocker_postgres_1 | tar x srv/db_9.3 && chmod --reference ../.vols/db srv/db_9.3 && chown --reference ../.vols/db srv/db_9.3 && rm -rf ../.vols/db && mv srv/db_9.3 ../.vols/db'

docker-compose run --rm postgres
docker-compose run --rm postgres bash
docker-compose up -d && docker-compose logs
docker-compose stop
docker-compose run --rm postgres bash
docker-compose rm -fv postgres
docker-compose run --rm postgres
docker-compose up -d && docker-compose logs -f
docker-compose stop
git clone https://github.com/kobotoolbox/kobocat.git
cd kobocat
docker build -f Dockerfile.kobocat_base .
passwd
sudo pstree 
byobu
sudo ifconfig docker0
byobu