Public Repository

Last pushed: 2 years ago
Short Description
Sample application using Koop with Docker.
Full Description

Koop Docker example

Sample application using Koop with Docker.

Work In Progress

Getting started


Grab docker, docker-machine, and docker-compose.

curl -L > docker
curl -L > docker-machine
curl -L`uname -s`-`uname -m` > docker-compose

chmod +x docker*
mv docker* /usr/local/bin/

Create your docker host with docker-machine.

NOTE: You can also use the VMware Fusion driver (--driver vmwarefusion) if it's available.

docker-machine create --driver virtualbox dev

Evaluate the docker environment variables for your shell.

eval "$(docker-machine env dev)"

At this point you should be able to start the koop server using docker-compose.

docker-compose up --no-deps koop

You should now have a koop server running using in-memory cache.

curl -XGET `docker-machine ip`:8000/gist/6021269

Koop persistent cache


Start up the PostGIS container using docker-compose.

docker-compose up -d postgis

Start the koop server with the KOOP_CACHE ENV set to postgis.

docker-compose up --no-deps koopPG

You can test that everything's working fine with a simple curl.

curl -XGET

You can even grab data processed by koop directly out of the PostGIS container.

docker exec koopdockerexample_postgis_1 psql -U postgres -d koopdev -x -c "SELECT * FROM \"Gist:6021269:0\""

-[ RECORD 1 ]------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
id      | 1
feature | {"type":"Feature","properties":{},"geometry":{"type":"Polygon","coordinates":[[[-119.00390625,50.28933925329178],[-116.19140625,29.38217507514529],[-91.7578125,32.84267363195431],[-82.79296874999999,39.639537564366684],[-102.48046875,53.014783245859206],[-119.00390625,50.28933925329178]]]}}
geom    |
geohash | 9xr1kvcw


Start up the ES container using docker-compose.

docker-compose up -d es

Passing -d will start the container in the background.

Start the koop server.

docker-compose up --no-deps koopES

Create a locally cached record of geographic data from a gist using the koop-gist plugin.

curl -XGET

Query the ElasticSearch cache for the newly created record.

curl -XGET

Without docker-compose

Start the cache backends for ES and PostGIS.

docker run --name postgis -p "5432:5432" -it kpettijohn/postgis
docker run --name es -p "9200:9200" -p "9300:9300" -it elasticsearch

Run a koop server for each of the backends.

docker run --name koopES -it -p "8000:8000" --link es:es -e KOOP_CACHE=es koopjs/koop
docker run --name koopPG -it -p "8000:8000" --link postgis:postgis -e KOOP_CACHE=postgis koopjs/koop koop postgis


Esri welcomes contributions from anyone and everyone. Please see our guidelines for contributing.



Docker Pull Command

Comments (0)