From ca920b83af49f72e2a6bd01b7948053c0268f52a Mon Sep 17 00:00:00 2001 From: Mathias Hansen Date: Sat, 11 Jul 2015 21:31:29 -0400 Subject: [PATCH] Added Docker support --- Dockerfile | 17 +++++++++++++++++ README.md | 22 ++++++++++++++++++++++ 2 files changed, 39 insertions(+) create mode 100644 Dockerfile diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 00000000..59d90c2d --- /dev/null +++ b/Dockerfile @@ -0,0 +1,17 @@ +FROM ubuntu:14.04 + +# Install python +RUN \ + apt-get update && \ + apt-get install -y python python-dev python-pip python-virtualenv + +# Install machine prerequirements +RUN apt-get install -y python-cairo python-gdal python-pip python-dev libpq-dev + +# Set up and configure machine +ADD . /machine +WORKDIR /machine +RUN pip install -U . + +# Default entrypoint +ENTRYPOINT ["openaddr-process-one"] \ No newline at end of file diff --git a/README.md b/README.md index cf442402..2638dfae 100644 --- a/README.md +++ b/README.md @@ -91,6 +91,28 @@ Run the complete batch process from the `openaddr` module: python -m openaddr.process_all -a -s -l data.openaddresses.io +Using Docker +----------- + +You can quickly set up a local machine in environment with docker, this is especially useful if you're looking to test changes to source conform files. + +First, build the docker image like so: + + docker build --rm -t openaddresses/machine . + +You can now any of the process scripts, the default script is `openaddr-process` + +Here's an example: + + docker run -it --rm -v `pwd`/../openaddresses:/openaddresses -v `pwd`/../output:/output openaddresses/machine -l output.log /openaddresses/sources/us-ny-nyc.json /output + +This will do the following: +* Mount `../openaddresses` on the host machine to `/openaddresses` in the docker container (this expects you to have the `openaddresses` repository cloned) +* Mount `../output` on the host machine to `/output` in the docker container (this allows you to have the processing output saved on the host machine) +* It will run the `openaddresses/machine` container that you just built +* The remaining arguments are sent directly to `openaddr-process-one` + + Extras ------