From 8b4c600d98b85655b3a1454ebf64f858b5fe54c8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ariel=20N=C3=BA=C3=B1ez?= Date: Thu, 16 Nov 2017 22:50:51 -0500 Subject: [PATCH] Add spatialite, switch to debian and local build (#114) --- Dockerfile | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/Dockerfile b/Dockerfile index 8bfc47d2..d0184d26 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,12 +1,21 @@ -FROM python:3.6 as build +FROM python:3.6-slim-stretch as build -ARG VERSION=0.11 -RUN pip install datasette==$VERSION +# Setup build dependencies +RUN apt update +RUN apt install -y python-dev gcc libsqlite3-mod-spatialite +# Add local code to the image instead of fetching from pypi. +ADD . /datasette -FROM python:3.6-slim +RUN pip install /datasette +FROM python:3.6-slim-stretch + +# Copy python dependencies COPY --from=build /usr/local/lib/python3.6/site-packages /usr/local/lib/python3.6/site-packages +# Copy executables COPY --from=build /usr/local/bin /usr/local/bin +# Copy spatial extensions +COPY --from=build /usr/lib/x86_64-linux-gnu /usr/lib/x86_64-linux-gnu EXPOSE 8001 CMD ["datasette"]