commit e2ec4adcbf954505f84dea6436af380e2bc0af72 Author: Marko Bocevski Date: Thu Aug 25 17:40:05 2016 +0200 Initial commit diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..903797e --- /dev/null +++ b/Makefile @@ -0,0 +1,9 @@ +VERSION := $(shell git describe --tags --exact-match 2>/dev/null || echo latest) +DOCKERHUB_NAMESPACE ?= keitaro +IMAGE := ${DOCKERHUB_NAMESPACE}/ckan:${VERSION} + +build: + docker build -t ${IMAGE} rootfs + +push: build + docker push ${IMAGE} diff --git a/rootfs/Dockerfile b/rootfs/Dockerfile new file mode 100644 index 0000000..d4537fb --- /dev/null +++ b/rootfs/Dockerfile @@ -0,0 +1,51 @@ +FROM keitaro/base:0.1 + +MAINTAINER Keitaro Inc + +ENV APP_DIR=/srv/app +ENV GIT_URL=https://github.com/ckan/ckan.git +ENV GIT_BRANCH=release-v2.5.2 +ENV APP_WSGI=ckan.wsgi +ENV CKAN_SITE_URL=http://localhost +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 \ + gettext \ + postgresql-client \ + postgresql-dev \ + python \ + py-pip \ + py-gunicorn + +# Temporary packages to build CKAN requirements +RUN apk add --no-cache --virtual .build-deps \ + gcc \ + musl-dev \ + python-dev + +# Fetch CKAN and install +RUN mkdir ${APP_DIR}/src && cd ${APP_DIR}/src && \ + git clone -b ${GIT_BRANCH} --depth=1 --single-branch ${GIT_URL} ckan && \ + cd ckan && \ + cp who.ini ${APP_DIR} && \ + python setup.py install && \ + pip install --no-cache-dir testrepository && \ + pip install --no-cache-dir --upgrade -r requirements.txt && \ + pip install --no-cache-dir html5lib==0.9999999 + +# Remove temporary packages +RUN apk del .build-deps + +# Default Extensions +RUN pip install --no-cache-dir git+https://github.com/okfn/ckanext-envvars.git#egg=ckanext-envvars + +# Create and update CKAN config +RUN paster --plugin=ckan make-config ckan ${APP_DIR}/production.ini +RUN paster --plugin=ckan config-tool ${APP_DIR}/production.ini "ckan.plugins = ${CKAN__PLUGINS}" + +EXPOSE 8000 + +CMD ["gunicorn", "--paste", "production.ini"]