Skip to content
This repository has been archived by the owner on Jan 24, 2018. It is now read-only.

Commit

Permalink
update docs
Browse files Browse the repository at this point in the history
  • Loading branch information
afirth committed Apr 13, 2015
1 parent 2df96f3 commit 6a18f08
Showing 1 changed file with 19 additions and 8 deletions.
27 changes: 19 additions & 8 deletions docs/source/installation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -166,41 +166,43 @@ If you already have a dataset on your machine, you can download and deploy the a

.. code-block:: bash
$ docker run -e GA4GH_DATA_SOURCE=/data -v my/ga4gh_data/:/data:ro -itd -p 8000:80 --name ga4gh_server afirth/ga4gh_apache_server:prod
$ docker run -e GA4GH_DATA_SOURCE=/data -v /my/ga4gh_data/:/data:ro -itd -p 8000:80 --name ga4gh_server afirth/ga4gh_apache_server:prod
If you do not have a dataset yet, you can deploy the a container which includes the demo data:
Replace ``/my/ga4gh_data/`` with the path to your data.

If you do not have a dataset yet, you can deploy a container which includes the demo data:

.. code-block:: bash
$ docker run -itd -p 8000:80 --name ga4gh_demo afirth/ga4gh_server_apache:demo
This will run the docker container in the background, and translate calls from your host environment
port 8000 to the docker container port 80. At that point you should be able to access it like a normal website.
port 8000 to the docker container port 80. At that point you should be able to access it like a normal website, albeit on port 8000.
Running in boot2docker, you will need to forward the port from the boot2docker vm to the host.
From a terminal on the host to forward traffic from localhost:8000 to the VM 8000 on OSX:

.. code-block:: bash
$ VBoxManage controlvm boot2docker-vm natpf1 "ga4gh,tcp,127.0.0.1,8000,,8000"
For more info see https://www.virtualbox.org/manual/ch06.html#natforward and https://github.com/CenturyLinkLabs/panamax-ui/wiki/How-To%3A-Port-Forwarding-on-VirtualBox
For more info on port forwarding see https://www.virtualbox.org/manual/ch06.html#natforward and https://github.com/CenturyLinkLabs/panamax-ui/wiki/How-To%3A-Port-Forwarding-on-VirtualBox

++++++++
Advanced
++++++++

If you want to build the images yourself, that is possible. The [afirth/ga4gh_server_apache repo](https://registry.hub.docker.com/u/afirth/ga4gh_server_apache/)
builds automatically on new commits, so this is only needed if you want to modify the Dockerfiles
builds automatically on new commits, so this is only needed if you want to modify the Dockerfiles, or build from a different source.

Build and run for production, serving a dataset on local host located at ``/my/dataset``
Build the code at server/ and run for production, serving a dataset on local host located at ``/my/dataset``

.. code-block:: bash
$ cd server/
$ docker build -t my-repo/my-image .
$ docker run -e GA4GH_DATA_SOURCE=/dataset -v /my/dataset:/dataset:ro -itd -p 8000:80 --name ga4gh_server my-repo/my-image
Build and run the production build, with the demo dataset in the container
Build and run the production build from above, with the demo dataset in the container
(you will need to modify the FROM line in ``/deploy/variants/demo/Dockerfile`` if you want to use your image from above as the base):

.. code-block:: bash
Expand All @@ -209,7 +211,14 @@ Build and run the production build, with the demo dataset in the container
$ docker build -t my-repo/my-demo-image .
$ docker run -itd -p 8000:80 --name ga4gh_demo my-repo/my-demo-image
##### Variants #####

Other Dockerfile implementations are available in the variants folder which install manually.
To build one of these images:

$ cd server/deploy/variants/xxxx
$ docker build -t my-repo/my-image .
$ docker run -itd -p 8000:80 --name my_container my-repo/my-image

++++++++++++++++++++++
Troubleshooting Docker
Expand All @@ -225,7 +234,7 @@ From a terminal on the host:
$ eval "$(boot2docker shellinit)"
$ boot2docker ssh
$ sudo udhcpc
> sudo udhcpc
(password is tcuser)
##### DEBUG #####
Expand All @@ -237,3 +246,5 @@ To enable DEBUG on your docker server, call docker run with ``-e GA4GH_DEBUG=Tru
$ docker run -itd -p 8000:80 --name ga4gh_demo -e GA4GH_DEBUG=True afirth/ga4gh_server_apache:demo
This will set the environment variable which is read by config.py

You can then get logs from the docker container by running ``docker logs (container)`` e.g. ``docker logs ga4gh_demo``

0 comments on commit 6a18f08

Please sign in to comment.