2017-12-16 20:41:58 +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-16 20:41:58 +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 11:06:46 +01:00
|
|
|
|
2017-12-21 10:39:22 +01:00
|
|
|
RUN \
|
2018-01-27 22:46:45 +01:00
|
|
|
# Add edge/testing repository
|
|
|
|
echo '@edge http://dl-cdn.alpinelinux.org/alpine/edge/testing' >>/etc/apk/repositories \
|
2017-12-21 10:39:22 +01:00
|
|
|
# Install runtime dependencies
|
2018-01-27 22:46:45 +01:00
|
|
|
&& apk --no-cache add geos@edge libjpeg-turbo libmagic libpq py2-pip zlib
|
2018-01-08 21:04:35 +01:00
|
|
|
|
|
|
|
RUN \
|
2017-12-21 10:39:22 +01:00
|
|
|
# Install build dependencies
|
2018-01-27 15:23:22 +01:00
|
|
|
apk --no-cache add --virtual .deps build-base git libjpeg-turbo-dev libxml2-dev libxslt-dev postgresql-dev python2-dev zlib-dev \
|
2017-12-21 10:39:22 +01:00
|
|
|
# Hackfix for python find_library('c') call
|
2017-12-16 20:41:58 +01:00
|
|
|
&& ln -s /lib/ld-musl-x86_64.so.1 /lib/libc.so.1 \
|
2017-12-21 10:39:22 +01:00
|
|
|
# Install CKAN
|
2017-12-16 20:41:58 +01:00
|
|
|
&& mkdir -p /srv/ckan \
|
|
|
|
&& cd /srv/ckan \
|
2017-12-20 11:06:46 +01:00
|
|
|
&& pip install -U setuptools \
|
2017-12-16 20:41:58 +01:00
|
|
|
&& pip install -e 'git+https://github.com/ckan/ckan.git#egg=ckan' \
|
2017-12-21 10:39:22 +01:00
|
|
|
# Force psycopg2 version update for compatibility with PostgreSQL 10
|
2017-12-16 20:41:58 +01:00
|
|
|
&& 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 \
|
2017-12-21 10:39:22 +01:00
|
|
|
# Install CKAN extensions
|
2017-12-16 20:41:58 +01:00
|
|
|
&& 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' \
|
|
|
|
&& pip install -e 'git+https://github.com/ckan/ckanext-mapviews#egg=ckanext_mapviews' \
|
|
|
|
&& pip install -e 'git+https://github.com/XVTSolutions/ckanext-spatialUI#egg=ckanext_spatialui' \
|
|
|
|
&& pip install -e 'git+https://github.com/aptivate/ckanext-datasetthumbnail#egg=ckanext_datasetthumbnail' \
|
|
|
|
&& 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 \
|
2017-12-21 10:39:22 +01:00
|
|
|
# Create OS user
|
2017-12-16 20:41:58 +01:00
|
|
|
&& 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 \
|
2017-12-21 10:39:22 +01:00
|
|
|
# Cleanup
|
2018-01-29 16:47:27 +01:00
|
|
|
&& apk --no-cache del .deps \
|
2017-12-16 20:41:58 +01:00
|
|
|
&& find /srv/ckan/src -name '.git*' -exec rm -rf {} + \
|
2018-01-18 15:35:32 +01:00
|
|
|
&& rm -rf /root/.cache
|
2017-12-16 20:41:58 +01:00
|
|
|
|
|
|
|
VOLUME ["/etc/ckan", "/srv/ckan/storage"]
|
2018-03-25 22:55:15 +02:00
|
|
|
EXPOSE 8080
|
2017-12-16 20:41:58 +01:00
|
|
|
|
|
|
|
USER ckan
|
|
|
|
CMD ["paster", "serve", "/etc/ckan/ckan.ini"]
|