docker-ckan/rootfs/Dockerfile

66 lines
2.0 KiB
Docker
Raw Normal View History

2016-08-25 17:40:05 +02:00
FROM keitaro/base:0.1
MAINTAINER Keitaro Inc <info@keitaro.info>
ENV APP_DIR=/srv/app
2016-10-26 09:28:54 +02:00
ENV SRC_DIR=/srv/app/src
2016-08-25 23:04:32 +02:00
ENV GIT_URL=https://github.com/keitaroinc/ckan.git
ENV GIT_BRANCH=ckan-2.5-map-fix3
ENV CKAN_SITE_URL=http://localhost:5000
2016-08-25 17:40:05 +02:00
ENV CKAN__PLUGINS image_view text_view recline_view datastore datapusher envvars
WORKDIR ${APP_DIR}
# Install necessary packages to run CKAN
RUN apk add --no-cache git \
2016-10-26 09:28:54 +02:00
gettext \
postgresql-client \
python \
py-pip \
py-gunicorn && \
2016-08-25 22:05:30 +02:00
# Temporary packages to build CKAN requirements
apk add --no-cache --virtual .build-deps \
2016-10-26 09:28:54 +02:00
postgresql-dev \
gcc \
make \
g++ \
autoconf \
automake \
libtool \
musl-dev \
python-dev && \
# Build and install libgeos to support geospatial
git clone -b 3.6.0 --depth=1 --single-branch https://git.osgeo.org/gogs/geos/geos.git ${SRC_DIR}/geos && \
cd ${SRC_DIR}/geos && \
./autogen.sh && \
./configure && \
make -j2 && \
make install && \
2016-08-25 22:05:30 +02:00
# Fetch CKAN and install
2016-10-26 09:28:54 +02:00
git clone -b ${GIT_BRANCH} --depth=1 --single-branch ${GIT_URL} ${SRC_DIR}/ckan && \
cd ${SRC_DIR}/ckan && \
2016-08-25 17:40:05 +02:00
cp who.ini ${APP_DIR} && \
python setup.py install && \
pip install --no-cache-dir testrepository && \
pip install --no-cache-dir --upgrade -r requirements.txt && \
2016-08-25 22:05:30 +02:00
# Fix issue with html5lib in 2.5.2
pip install --no-cache-dir html5lib==0.9999999 && \
# Remove temporary packages and files
apk del .build-deps && \
2016-10-26 09:28:54 +02:00
rm -rf ${SRC_DIR}
2016-08-25 17:40:05 +02:00
# Default Extensions
2016-08-25 22:05:30 +02:00
RUN pip install --no-cache-dir git+https://github.com/okfn/ckanext-envvars.git#egg=ckanext-envvars && \
# Create and update CKAN config
paster --plugin=ckan make-config ckan ${APP_DIR}/production.ini && \
paster --plugin=ckan config-tool ${APP_DIR}/production.ini "ckan.plugins = ${CKAN__PLUGINS}"
2016-08-25 17:40:05 +02:00
2016-10-26 09:28:54 +02:00
# CKAN plugins to enable
ENV CKAN__PLUGINS image_view text_view recline_view datastore datapusher envvars
2016-08-25 22:05:30 +02:00
COPY setup ${APP_DIR}
2016-08-25 17:40:05 +02:00
2016-08-25 22:13:02 +02:00
EXPOSE 5000
2016-08-25 17:40:05 +02:00
2016-08-25 22:05:30 +02:00
CMD ["/srv/app/start_ckan.sh"]