Skip to content

Instantly share code, notes, and snippets.

@gtalarico
Created October 21, 2020 17:22
Show Gist options
  • Save gtalarico/b6123596a4247a5e6fa5fb92cd675e84 to your computer and use it in GitHub Desktop.
Save gtalarico/b6123596a4247a5e6fa5fb92cd675e84 to your computer and use it in GitHub Desktop.
Docker Jupyter for GIS
FROM osgeo/gdal
ENV PORT=8888
RUN apt-get update
RUN apt-get install -y \
python3-pip
RUN python -m pip install \
gdal \
geopandas \
jupyter \
matplotlib \
descartes \
mapclassify \
pygeos
RUN mkdir code
WORKDIR /code
ENV TINI_VERSION v0.6.0
ADD https://github.com/krallin/tini/releases/download/${TINI_VERSION}/tini /usr/bin/tini
RUN chmod +x /usr/bin/tini
ENTRYPOINT ["/usr/bin/tini", "--"]
CMD ["jupyter", "notebook", "--port=8888", "--no-browser", "--ip=0.0.0.0", "--allow-root"]
.PHONY:
build:
docker build . -t gdal -f Dockerfile
run:
docker run --rm -p 8888:8888 --name gdal --mount "type=bind,source=${PWD}/.,target=/code" gdal
bash:
docker exec -it gdal bash
postgis:
docker run --rm --name postgis -p 5432:5432 -e POSTGRES_PASSWORD=postgres postgis/postgis
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment