okfn / docker-ckan

Docker images and Docker Compose setup for CKAN [Not Maintained]
GNU Affero General Public License v3.0
83 stars 91 forks source link

Allow to optionally choose PostGIS enabled image #38

Open hvwaldow opened 5 years ago

hvwaldow commented 5 years ago

We need PostGIS for ckanext-spatial. Also: replaced deprecated option linkswith depends_onin docker-compose[.dev].yml

avdata99 commented 4 years ago

Postgis was removed. I agree, it's a good idea to add a easy way to add this when required.

reinvantveer commented 4 years ago

@hvwaldow have you had good experiences with installing the spatial extension itself? I couldn't get shapely installed on the Alpine image. It keeps complaining that it can't find the geos libraries, even if I point the environment variable GEOS_CONFIG to /usr/bin/geos-config. Would be interested in the Docker recipe for that. Haven't found anything useful on stackoverflow.

I tried:

FROM openknowledge/ckan-dev:2.8

# Set timezone
ARG TZ
RUN cp /usr/share/zoneinfo/$TZ /etc/localtime
RUN echo $TZ > /etc/timezone

RUN echo "http://mirror.leaseweb.com/alpine/edge/community" >> /etc/apk/repositories
RUN echo "http://dl-cdn.alpinelinux.org/alpine/edge/community" >> /etc/apk/repositories
RUN apk add --virtual .build-deps \
        --repository http://dl-cdn.alpinelinux.org/alpine/edge/community \
        --repository http://dl-cdn.alpinelinux.org/alpine/edge/main \
        gcc libc-dev geos-dev geos && \
    runDeps="$(scanelf --needed --nobanner --recursive /usr/local \
    | awk '{ gsub(/,/, "\nso:", $2); print "so:" $2 }' \
    | xargs -r apk info --installed \
    | sort -u)" && \
    apk add --virtual .rundeps
RUN geos-config --cflags
RUN which geos-config
RUN GEOS_CONFIG=/usr/bin/geos-config pip install shapely

RUN pip install -e git+https://github.com/ckan/ckanext-spatial.git#egg=ckanext-spatial && \
    pip install -r https://raw.githubusercontent.com/ckan/ckanext-spatial/master/pip-requirements.txt