]> git.jsancho.org Git - datasette-pytables.git/blob - Dockerfile
Publish fixtures in the appropiate file
[datasette-pytables.git] / Dockerfile
1 FROM python:3.6-slim-stretch as build
2
3 # Setup build dependencies
4 RUN apt update \
5 && apt install -y python3-dev build-essential wget libxml2-dev libproj-dev libgeos-dev libsqlite3-dev zlib1g-dev pkg-config \
6  && apt clean
7
8
9 RUN wget "https://www.sqlite.org/2018/sqlite-autoconf-3230100.tar.gz" && tar xzf sqlite-autoconf-3230100.tar.gz \
10     && cd sqlite-autoconf-3230100 && ./configure --disable-static --enable-fts5 --enable-json1 CFLAGS="-g -O2 -DSQLITE_ENABLE_FTS3=1 -DSQLITE_ENABLE_FTS4=1 -DSQLITE_ENABLE_RTREE=1 -DSQLITE_ENABLE_JSON1" \
11     && make && make install
12
13 RUN wget "https://www.gaia-gis.it/gaia-sins/freexl-1.0.5.tar.gz" && tar zxf freexl-1.0.5.tar.gz \
14     && cd freexl-1.0.5 && ./configure && make && make install
15
16 RUN wget "https://www.gaia-gis.it/gaia-sins/libspatialite-4.4.0-RC0.tar.gz" && tar zxf libspatialite-4.4.0-RC0.tar.gz \
17     && cd libspatialite-4.4.0-RC0 && ./configure && make && make install
18
19 RUN wget "https://www.gaia-gis.it/gaia-sins/readosm-1.1.0.tar.gz" && tar zxf readosm-1.1.0.tar.gz && cd readosm-1.1.0 && ./configure && make && make install
20
21 RUN wget "https://www.gaia-gis.it/gaia-sins/spatialite-tools-4.4.0-RC0.tar.gz" && tar zxf spatialite-tools-4.4.0-RC0.tar.gz \
22     && cd spatialite-tools-4.4.0-RC0 && ./configure && make && make install
23
24
25 # Add local code to the image instead of fetching from pypi.
26 COPY . /datasette-pytables
27
28 RUN pip install /datasette-pytables
29
30 FROM python:3.6-slim-stretch
31
32 # Copy python dependencies and spatialite libraries
33 COPY --from=build /usr/local/lib/ /usr/local/lib/
34 # Copy executables
35 COPY --from=build /usr/local/bin /usr/local/bin
36 # Copy spatial extensions
37 COPY --from=build /usr/lib/x86_64-linux-gnu /usr/lib/x86_64-linux-gnu
38
39 ENV LD_LIBRARY_PATH=/usr/local/lib
40
41 EXPOSE 8001
42 CMD ["datasette"]