diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..c018357 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,6 @@ +FROM jonduckworthdg/geopandas-base +COPY . /CS_Urban_Indicators +WORKDIR /CS_Urban_Indicators +RUN pip install --upgrade pip +RUN pip install -r requirements.txt +CMD python ./listen.py \ No newline at end of file diff --git a/README.md b/README.md index 57903ed..ce43c6b 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,39 @@ # README +## Dockerization + +### Deploy modules + +Dockerization allows us to deploy the modules in any server with docker. The deployment created a docker image with all the requirements specified in `requirements.txt` and the contents of the local `CS_Urban_Indicators` directory, and runs the listen.py script. + +The following commands build the image and then run a container using the image: +``` +> docker build -t python-urban-indicators . +> docker run -d python-urban-indicators +``` + +Note that the container is running even though nothing shows up. To see its status, attache to the container: +``` +> docker container attach python-urban-indicators +``` + +### Use a container for testing + +Building the image takes a while, which is why we created a light-weight image that can be used for testing during development (see [urban-indicator-dev](https://github.com/crisjf/urban-indicator-dev)). + +First, pull the image +``` +> docker pull crisjf/urban-indicators-dev +``` + +Then, run a container using the image. It will automatically start a bash. +The following command also makes sure that the current directory is mounted to the container (run from the directory of the repo): +``` +> docker run -it -v "$(pwd)":/home/CS_Urban_Indicators crisjf/urban-indicators-dev +``` + + + ## Accessibility indicator format The Handler class combines the results of all heatmaps indicator into one consolidated cityio-geojson with the following format: diff --git a/requirements.txt b/requirements.txt new file mode 100644 index 0000000..547d0b2 --- /dev/null +++ b/requirements.txt @@ -0,0 +1,57 @@ +affine==2.3.0 +appdirs==1.4.3 +attrs==19.3.0 +beautifulsoup4==4.9.0 +bs4==0.0.1 +certifi==2020.4.5.1 +chardet==3.0.4 +Click==7.0 +click-plugins==1.0.4 +cligj==0.5.0 +cycler==0.10.0 +decorator==4.4.2 +descartes==1.1.0 +docutils==0.16 +Fiona==1.7.13 +geographiclib==1.50 +Geohash==1.0 +geojson==2.5.0 +geopandas==0.7.0 +geopy==1.21.0 +idna==2.9 +importlib-metadata==1.6.0 +joblib==0.14.1 +json5==0.9.4 +jsonschema==3.2.0 +kiwisolver==1.2.0 +matplotlib==3.2.1 +munch==2.3.2 +networkx==2.4 +numpy==1.18.2 +osmnx==0.12 +osmxtract==0.0.1 +pandas==1.0.3 +patsy==0.5.1 +pyparsing==2.4.7 +pyproj==2.6.0 +pyrsistent==0.16.0 +python-dateutil==2.7.3 +python-geohash==0.8.5 +pytz==2018.5 +rasterio==1.1.3 +requests==2.23.0 +Rtree==0.9.4 +scikit-learn==0.22.2.post1 +scipy==1.4.1 +Shapely==1.7.0 +six==1.11.0 +sklearn==0.0 +snuggs==1.4.7 +soupsieve==2.0 +statsmodels==0.11.1 +tfidf-matcher==0.2.1 +tqdm==4.45.0 +urllib3==1.25.8 +wget==3.2 +xlrd==1.2.0 +zipp==3.1.0 \ No newline at end of file