From bcf4295086186ab4c999490f742d1da0a426ef91 Mon Sep 17 00:00:00 2001 From: Disassembler Date: Mon, 30 Apr 2018 22:02:54 +0200 Subject: [PATCH] Migrate CKAN to S6 supervisor --- ckan/Dockerfile | 7 ++++--- ckan/docker/etc/services.d/.s6-svscan/finish | 3 +++ ckan/docker/etc/services.d/ckan/run | 5 +++++ 3 files changed, 12 insertions(+), 3 deletions(-) create mode 100755 ckan/docker/etc/services.d/.s6-svscan/finish create mode 100755 ckan/docker/etc/services.d/ckan/run diff --git a/ckan/Dockerfile b/ckan/Dockerfile index 75e8a4e..5c953ec 100644 --- a/ckan/Dockerfile +++ b/ckan/Dockerfile @@ -13,7 +13,7 @@ RUN \ # Add edge/testing repository echo '@edge http://dl-cdn.alpinelinux.org/alpine/edge/testing' >>/etc/apk/repositories \ # Install runtime dependencies - && apk --no-cache add geos@edge libjpeg-turbo libmagic libpq mailcap py2-pip zlib + && apk --no-cache add geos@edge libjpeg-turbo libmagic libpq mailcap py2-pip s6 zlib RUN \ # Install build dependencies @@ -47,8 +47,9 @@ RUN \ && find /srv/ckan/src -name '.git*' -exec rm -rf {} + \ && rm -rf /root/.cache +COPY docker/ / + VOLUME ["/etc/ckan", "/srv/ckan/storage"] EXPOSE 8080 -USER ckan -CMD ["paster", "serve", "/etc/ckan/ckan.ini"] +CMD ["s6-svscan", "/etc/services.d"] diff --git a/ckan/docker/etc/services.d/.s6-svscan/finish b/ckan/docker/etc/services.d/.s6-svscan/finish new file mode 100755 index 0000000..78d5fdc --- /dev/null +++ b/ckan/docker/etc/services.d/.s6-svscan/finish @@ -0,0 +1,3 @@ +#!/bin/sh + +/bin/true diff --git a/ckan/docker/etc/services.d/ckan/run b/ckan/docker/etc/services.d/ckan/run new file mode 100755 index 0000000..d37675e --- /dev/null +++ b/ckan/docker/etc/services.d/ckan/run @@ -0,0 +1,5 @@ +#!/bin/execlineb -P + +fdmove -c 2 1 +s6-setuidgid 8003:8003 +/usr/bin/paster serve /etc/ckan/ckan.ini