Spotter-VM/lxc-apps/ckan/ckan-datapusher.image

40 lines
1.4 KiB
Plaintext

IMAGE ckan-datapusher_0.0.16-200313
FROM alpine3.10-python2.7_2.7.16-200313
# Alpine 3.11 discontinued uwsgi-python2 module
RUN EOF
# Install runtime dependencies
apk --no-cache add libffi 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@e662e3c33e069ac174cdb4fb1d61121f0ba4bb3a#egg=datapusher'
# Hackfix the X509_STORE_CTX wrapper
sed -i 's/\[security\]//' /srv/ckan-datapusher/src/datapusher/requirements.txt
pip install -r /srv/ckan-datapusher/src/datapusher/requirements.txt
# Hackfix werkzeug==1.0.0 proxy_fix import
# https://github.com/ckan/ckan-service-provider/pull/49
sed -i 's/werkzeug\.contrib\.fixers/werkzeug.middleware.proxy_fix/' /usr/lib/python2.7/site-packages/ckanserviceprovider/web.py
# Create OS user
addgroup -S -g 8080 ckandp
adduser -S -u 8080 -h /srv/ckan-datapusher -s /bin/false -g ckandp -G ckandp ckandp
chown -R ckandp:ckandp /srv/ckan-datapusher
# Cleanup
apk --no-cache del .deps
find /srv/ckan-datapusher/src -name '.git*' -exec rm -rf {} +
rm -rf /root/.cache
EOF
COPY ckan-datapusher.image.d
CMD /bin/execlineb -P /run