From 9724190d8ed38f7e06cadaa81a77135209b54b0d Mon Sep 17 00:00:00 2001 From: Disassembler Date: Thu, 21 Dec 2017 10:39:22 +0100 Subject: [PATCH] Add CKAN + DataPusher Dockerfile comments --- ckan-datapusher/Dockerfile | 16 +++++++++++++--- ckan/Dockerfile | 20 +++++++++++++++++--- 2 files changed, 30 insertions(+), 6 deletions(-) diff --git a/ckan-datapusher/Dockerfile b/ckan-datapusher/Dockerfile index a6e26dd..603e68b 100644 --- a/ckan-datapusher/Dockerfile +++ b/ckan-datapusher/Dockerfile @@ -1,20 +1,30 @@ FROM alpine:3.7 MAINTAINER Disassembler -RUN apk --no-cache add python2 +RUN \ + # Install Python2 runtime + apk --no-cache add python2 -RUN apk --no-cache add libxml2 libxslt +RUN \ + # Install runtime XML dependencies (shared with CKAN) + apk --no-cache add libxml2 libxslt -RUN apk --no-cache add libffi libressl libxml2 libxslt uwsgi-python \ +RUN \ + # Install runtime dependencies + apk --no-cache add libffi libressl libxml2 libxslt uwsgi-python \ + # Install build dependencies && apk --no-cache add --virtual .deps build-base git libffi-dev libressl-dev libxml2-dev libxslt-dev py2-pip python2-dev \ + # Install CKAN DataPusher && mkdir -p /srv/ckan-datapusher \ && cd /srv/ckan-datapusher \ && pip install -U setuptools \ && pip install -e 'git+https://github.com/ckan/datapusher.git#egg=datapusher' \ && pip install -r /srv/ckan-datapusher/src/datapusher/requirements.txt \ + # Create OS user && addgroup -S -g 8004 ckan-datapusher \ && adduser -S -u 8004 -h /srv/ckan-datapusher -s /bin/false -g ckan-datapusher -G ckan-datapusher ckan-datapusher \ && chown -R ckan-datapusher:ckan-datapusher /srv/ckan-datapusher \ + # Cleanup && apk del .deps \ && find /srv/ckan-datapusher/src -name '.git*' -exec rm -rf {} + \ && rm -rf /root \ diff --git a/ckan/Dockerfile b/ckan/Dockerfile index 35db94e..ea8da5b 100644 --- a/ckan/Dockerfile +++ b/ckan/Dockerfile @@ -1,21 +1,33 @@ FROM alpine:3.7 MAINTAINER Disassembler -RUN apk --no-cache add python2 +RUN \ + # Install Python2 runtime + apk --no-cache add python2 -RUN apk --no-cache add libxml2 libxslt +RUN \ + # Install runtime XML dependencies (shared with CKAN DataPusher) + apk --no-cache add libxml2 libxslt -RUN apk --no-cache add libjpeg-turbo libmagic libpq py2-pip zlib \ +RUN \ + # Install runtime dependencies + apk --no-cache add libjpeg-turbo libmagic libpq py2-pip zlib \ + # Install build dependencies && apk --no-cache add --virtual .deps git build-base libjpeg-turbo-dev libxml2-dev libxslt-dev postgresql-dev python2-dev zlib-dev \ + # Add edge/testing repository for postgis support && echo 'http://repository.fit.cvut.cz/mirrors/alpine/edge/testing' >>/etc/apk/repositories \ && apk --no-cache add geos \ + # Hackfix for python find_library('c') call && ln -s /lib/ld-musl-x86_64.so.1 /lib/libc.so.1 \ + # Install CKAN && mkdir -p /srv/ckan \ && cd /srv/ckan \ && pip install -U setuptools \ && pip install -e 'git+https://github.com/ckan/ckan.git#egg=ckan' \ + # Force psycopg2 version update for compatibility with PostgreSQL 10 && sed -i 's/psycopg2==2.4.5/psycopg2==2.7.1/' /srv/ckan/src/ckan/requirements.txt \ && pip install -r /srv/ckan/src/ckan/requirements.txt \ + # Install CKAN extensions && pip install -e 'git+https://github.com/ckan/ckanext-basiccharts#egg=ckanext_basiccharts' \ && pip install -e 'git+https://github.com/ckan/ckanext-spatial#egg=ckanext_spatial' \ && pip install -e 'git+https://github.com/ckan/ckanext-geoview#egg=ckanext_geoview' \ @@ -26,9 +38,11 @@ RUN apk --no-cache add libjpeg-turbo libmagic libpq py2-pip zlib \ && pip install -e 'git+https://github.com/datagvat/ckanext-dgvat_xls#egg=ckanext_dgvat_xls' \ && pip install -r /srv/ckan/src/ckanext-spatial/pip-requirements.txt \ && pip install -r /srv/ckan/src/ckanext-dgvat-xls/requirements.txt \ + # Create OS user && addgroup -S -g 8003 ckan \ && adduser -S -u 8003 -h /srv/ckan -s /bin/false -g ckan -G ckan ckan \ && chown -R ckan:ckan /srv/ckan \ + # Cleanup && apk del .deps \ && find /srv/ckan/src -name '.git*' -exec rm -rf {} + \ && rm -rf /root \