Skip to content

Automated Deployment (Docker)

James Case edited this page Jan 31, 2015 · 24 revisions

OOI UI Docker Images and Containers

The following describes the process by which the OOI UI and associated OOI UI Services and database server are built and launched in order to obtain a complete distribution of the OOI UI.

TODO:

  • Add support for building containers against specific branch or tag
  • Check if there is already a running container before launching a new one?

Host Configuration

Start with any Linux-based OS or on Windows Boot2Docker

yum -y install docker

chkconfig docker on

yum -y install git

Install supervisord

Edit or create /etc/default/docker and add this line: DOCKER_OPTS="-r=false $DOCKER_OPTS"

Edit /etc/supervisord.conf

Step 1: Launch PostgreSQL Service

Build Image or Fetch from DockerHub

git clone https://github.com/oceanzus/docker-postgis.git

sudo docker build --no-cache=true -t="oceanzus/docker_postgis:v1" .

Launch Container

mkdir $HOME/postgres_data

sudo docker run -e USERNAME=<username> -e PASS=<password> -a stdout -a stderr --rm=true -d --name ooiuidb -v $HOME/postgres_data:/var/lib/postgresql oceanzus/docker_postgis:v1

Optional - Connect to Container (psql)

sudo docker ps

sudo docker inspect <container id>

psql -h <ip from inspect> -U <username> -W postgres

Step 2: Run OOI UI Services

Build Image

git clone https://github.com/oceanzus/ooi-ui-services-deploy.git

sudo docker build --no-cache=true -t="oceanzus/ooi_ui_services_deploy:v1" .

Launch Container

sudo docker run -e HOST_IP=0.0.0.0 -e DB_PORT=<port> -e DB_USER=<user> -e DB_PASS=<password> -e DB_HOST=<url> -e DB_NAME=<database name> -e DB_RESET=<true|false> -a stdout -a stderr --rm=true -d --name ooiuiservices --link ooiuidb:ooiuidb oceanzus/ooi_ui_services_deploy:v1

Optional - Manual Container Startup

sudo docker run -e HOST_IP=0.0.0.0 -e DB_PORT=<port> -e DB_USER=<user> -e DB_PASS=<password> -e DB_HOST=<url> -e DB_NAME=<database name> -e DB_RESET=<true|false> -t -i --name ooiuiservices --link ooiuidb:ooiuidb oceanzus/ooi_ui_services_deploy:v1 /bin/bash

./start_ooi-ui-services.sh

Step 3: Run OOI UI

Build Image

git clone https://github.com/oceanzus/ooi-ui-deploy.git

sudo docker build --no-cache=true -t="oceanzus/ooi_ui_deploy:v1" .

Launch Container

sudo docker run -a stdout -a stderr --rm=true -d -p <host external ip>:5000:5000 --name ooiui --link ooiuiservices:ooiuiservices oceanzus/ooi_ui_deploy:v1

Optional - Manual Container Startup

sudo docker run -t -i -p <host external ip>:5000:5000 --name ooiui --link ooiuiservices:ooiuiservices oceanzus/ooi_ui_deploy:v1 /bin/bash

./start_ooi-ui.sh

Remove ALL Docker containers

sudo docker rm $(docker ps -a -q)

Remove ALL Docker images

sudo docker rmi $(docker images -q)

Clone this wiki locally