2017-12-20 15:41:29 +01:00
|
|
|
FROM alpine:3.7
|
|
|
|
MAINTAINER Disassembler <disassembler@dasm.cz>
|
|
|
|
|
2017-12-21 10:39:22 +01:00
|
|
|
RUN \
|
|
|
|
# Install Python2 runtime
|
|
|
|
apk --no-cache add python2
|
2017-12-20 15:41:29 +01:00
|
|
|
|
2017-12-21 10:39:22 +01:00
|
|
|
RUN \
|
2017-12-28 09:45:21 +01:00
|
|
|
# Install runtime XML dependencies
|
2017-12-21 10:39:22 +01:00
|
|
|
apk --no-cache add libxml2 libxslt
|
2017-12-20 15:41:29 +01:00
|
|
|
|
2017-12-21 10:39:22 +01:00
|
|
|
RUN \
|
|
|
|
# Install runtime dependencies
|
2018-01-08 21:04:35 +01:00
|
|
|
apk --no-cache add libffi libressl uwsgi-python
|
|
|
|
|
|
|
|
RUN \
|
2017-12-21 10:39:22 +01:00
|
|
|
# Install build dependencies
|
2018-01-08 21:04:35 +01:00
|
|
|
apk --no-cache add --virtual .deps build-base git libffi-dev libressl-dev libxml2-dev libxslt-dev py2-pip python2-dev \
|
2017-12-21 10:39:22 +01:00
|
|
|
# Install CKAN DataPusher
|
2017-12-20 15:41:29 +01:00
|
|
|
&& 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' \
|
2018-02-01 17:45:43 +01:00
|
|
|
# Hackfix the X509_STORE_CTX wrapper
|
|
|
|
&& sed -i 's/\[security\]//' /srv/ckan-datapusher/src/datapusher/requirements.txt \
|
2017-12-20 15:41:29 +01:00
|
|
|
&& pip install -r /srv/ckan-datapusher/src/datapusher/requirements.txt \
|
2017-12-21 10:39:22 +01:00
|
|
|
# Create OS user
|
2017-12-20 15:41:29 +01:00
|
|
|
&& 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 \
|
2017-12-21 10:39:22 +01:00
|
|
|
# Cleanup
|
2018-01-29 16:47:27 +01:00
|
|
|
&& apk --no-cache del .deps \
|
2017-12-20 15:41:29 +01:00
|
|
|
&& find /srv/ckan-datapusher/src -name '.git*' -exec rm -rf {} + \
|
2018-01-24 16:28:41 +01:00
|
|
|
&& rm -rf /root/.cache
|
2017-12-20 15:41:29 +01:00
|
|
|
|
2018-02-01 15:34:43 +01:00
|
|
|
COPY docker/ /
|
|
|
|
|
|
|
|
RUN \
|
|
|
|
# Hackfix the self-signed certificate verification
|
|
|
|
cd /usr/lib/python2.7/site-packages \
|
|
|
|
&& patch -p0 </srv/ckan-datapusher/ssl_verify.patch
|
|
|
|
|
2017-12-20 15:41:29 +01:00
|
|
|
VOLUME ["/etc/ckan-datapusher", "/srv/ckan-datapusher/data"]
|
2018-03-25 22:55:15 +02:00
|
|
|
EXPOSE 8080
|
2017-12-20 15:41:29 +01:00
|
|
|
|
|
|
|
USER ckan-datapusher
|
2018-03-25 22:55:15 +02:00
|
|
|
CMD ["uwsgi", "--plugin", "python", "--http-socket", "0.0.0.0:8080", "--wsgi-file", "/etc/ckan-datapusher/datapusher.wsgi", "--enable-threads"]
|