From 1cb7032aea0822e9af393d850158f612dbde70b0 Mon Sep 17 00:00:00 2001 From: Christoph Paulik Date: Sun, 8 Nov 2015 11:45:38 +0100 Subject: [PATCH] Add Dockerfile and instructions - starts an empty instance with an admin user --- docker/Dockerfile | 55 +++++++++++++++++++++++++++++++++++++++++++++++ docker/Readme.md | 34 +++++++++++++++++++++++++++++ 2 files changed, 89 insertions(+) create mode 100644 docker/Dockerfile create mode 100644 docker/Readme.md diff --git a/docker/Dockerfile b/docker/Dockerfile new file mode 100644 index 000000000..e1fd20651 --- /dev/null +++ b/docker/Dockerfile @@ -0,0 +1,55 @@ +# Pull base image. +FROM ubuntu:14.04 + +RUN apt-get update +RUN apt-get install -y apt-file +RUN apt-get install -y python-software-properties software-properties-common +RUN add-apt-repository -y ppa:ubuntugis/ubuntugis-unstable +RUN apt-get update \ +&& apt-get install -y aptitude \ +&& aptitude install -y \ + gdal-bin \ + libgdal1-dev \ + libxml2 \ + python-lxml \ + python-libxml2 \ + libproj0 \ + libproj-dev \ + libgeos-dev \ + libgeos++-dev \ + cgi-mapserver \ + python-mapscript \ + python-psycopg2 \ + postgis \ + python-gdal \ + python-pip \ + wget \ + git +RUN apt-get install -y libpython-dev +RUN wget https://pypi.python.org/packages/source/p/pysqlite/pysqlite-2.6.3.tar.gz \ +&& tar xzf pysqlite-2.6.3.tar.gz \ +&& cd pysqlite-2.6.3 \ +&& sed -i "/define=SQLITE_OMIT_LOAD_EXTENSION/c\#define=SQLITE_OMIT_LOAD_EXTENSION" setup.cfg \ +&& sudo python setup.py install +RUN cd - \ +&& pip install "django>=1.7,<1.8" \ +&& pip install twisted \ +&& django-admin.py --version +RUN git clone --recursive https://github.com/EOxServer/eoxserver +RUN cd eoxserver \ +&& python setup.py develop + +# temporary fix of spatialite init +# takes very long if not set to 1 +RUN cd eoxserver/eoxserver/core/commands \ +&& sed -i 's/InitSpatialMetadata()/InitSpatialMetadata(1)/g' create_instance.py + +RUN cd eoxserver \ +&& eoxserver-admin.py create_instance eoxtest --init-spatialite +RUN cd eoxserver/eoxtest \ +&& python manage.py syncdb --noinput --traceback \ +&& echo "from django.contrib.auth.models import User; User.objects.create_superuser('admin','test@eox.at','admin')" | python manage.py shell + + +ENTRYPOINT cd eoxserver/eoxtest \ +&& python manage.py runserver 0.0.0.0:8000 diff --git a/docker/Readme.md b/docker/Readme.md new file mode 100644 index 000000000..ddd23812f --- /dev/null +++ b/docker/Readme.md @@ -0,0 +1,34 @@ +# Start EOXServer using docker + +Install [docker](https://www.docker.com/) for your system. + +The next steps are: + +```sh +git clone git@github.com:EOxServer/eoxserver.git +cd eoxserver/ +docker build docker +``` + +This will give you a docker image ID as the last output e.g `55453fbf21c9`. The +image ID can also be retrieved using the `docker images` command. The last image +you built should be at the top of the list. + +Run + +```sh +docker run -i -t --rm -p 8080:8000 $IMAGE_ID +``` + +where `$IMAGE_ID` is the image ID from before e.g. `55453fbf21c9` + +The first few unique characters also work: + +```sh +docker run -i -t --rm -p 8080:8000 5545 +``` + +EOxServer is now accessible at [http://localhost:8080/](http://localhost:8080/). +And you can login to the `Admin Client` using: +- username: admin +- password: admin