Closed mjanez closed 7 months ago
Note Info about
xloader
into separate server.
Adapt: ckan/ckan-base-xloader
to:
mjanez/ckan-docker-spatial base Dockerfile
CKAN 2.9.9
COMMAND | SIZE | COMMENT |
---|---|---|
ENV CKAN_INI=/srv/app/ckan.ini | 0B | buildkit.dockerfile.v0 |
ENV PIP_SRC=/srv/app/src | 0B | buildkit.dockerfile.v0 |
ENV CKAN_STORAGE_PATH=/var/lib/ckan | 0B | buildkit.dockerfile.v0 |
ENV CKAN_GIT_URL=https://github.com/ckan/ckan.git | 0B | buildkit.dockerfile.v0 |
ENV XLOADER_GIT_URL=https://github.com/ckan/ckanext-xloader.git | 0B | buildkit.dockerfile.v0 |
ENV CKAN_GIT_BRANCH=ckan-2.10.1 | 0B | buildkit.dockerfile.v0 |
ENV XLOADER_GIT_BRANCH=1.0.1 | 0B | buildkit.dockerfile.v0 |
ENV XLOADER__PLUGINS=image_view text_view recline_view datastore xloader envvars | 0B | buildkit.dockerfile.v0 |
ENV UWSGI_HARAKIRI=50 | 0B | buildkit.dockerfile.v0 |
WORKDIR /srv/app | 0B | buildkit.dockerfile.v0 |
RUN /bin/sh -c apk add --no-cache tzdata git gettext postgresql-client python3 libxml2 libxslt musl-dev uwsgi uwsgi-http uwsgi-corerouter uwsgi-python py3-gevent uwsgi-gevent libmagic curl patch bash && apk add --no-cache --virtual .build-deps postgresql-dev gcc make g++ autoconf automake libtool python3-dev libxml2-dev libxslt-dev linux-headers openssl-dev libffi-dev cargo && mkdir -p ${SRC_DIR} && curl -o ${SRC_DIR}/get-pip.py https://bootstrap.pypa.io/get-pip.py && python3 ${SRC_DIR}/get-pip.py && pip3 install supervisor && mkdir /etc/supervisord.d && rm -rf ${SRC_DIR}/get-pip.py # buildkit | 1.65GB | buildkit.dockerfile.v0 |
RUN /bin/sh -c pip3 install -e git+${CKAN_GIT_URL}@${CKAN_GIT_BRANCH}#egg=ckan && cd ${SRC_DIR}/ckan && cp who.ini ${APP_DIR} && pip3 install --no-binary markdown -r requirements.txt && pip3 install -e git+https://github.com/okfn/ckanext-envvars.git#egg=ckanext-envvars && ckan generate config ${CKAN_INI} && ckan config-tool ${CKAN_INI} "beaker.session.secret = " && ckan config-tool ${CKAN_INI} "ckan.plugins = ${XLOADER__PLUGINS}" # buildkit | 234MB | buildkit.dockerfile.v0 |
RUN /bin/sh -c addgroup -g 92 -S ckan && adduser -u 92 -h /home/ckan -s /bin/bash -D -G ckan ckan # buildkit | 5.09kB | buildkit.dockerfile.v0 |
RUN /bin/sh -c mkdir -p ${CKAN_STORAGE_PATH} && chown -R ckan:ckan ${CKAN_STORAGE_PATH} # buildkit | 0B | buildkit.dockerfile.v0 |
RUN /bin/sh -c mkdir -p ${APP_DIR}/src && git clone -b ${XLOADER_VERSION} --depth=1 --single-branch ${XLOADER_GIT_URL} && cd ckanext-xloader && python3 setup.py install && pip3 install -r requirements.txt && pip3 install -U requests[security] # buildkit | 104MB | buildkit.dockerfile.v0 |
COPY setup/supervisord.conf /etc # buildkit | 480B | buildkit.dockerfile.v0 |
COPY setup/prerun.py /srv/app # buildkit | 7.07kB | buildkit.dockerfile.v0 |
COPY setup/start_ckan.sh /srv/app # buildkit | 2.67kB | buildkit.dockerfile.v0 |
COPY setup/supervisor.worker.conf /etc/supervisord.d/supervisor.worker.conf # buildkit | 289B | buildkit.dockerfile.v0 |
ADD https://raw.githubusercontent.com/ckan/ckan/ckan-2.10.1/wsgi.py /srv/app # buildkit | 582B | buildkit.dockerfile.v0 |
RUN /bin/sh -c chmod 644 ${APP_DIR}/wsgi.py # buildkit | 582B | buildkit.dockerfile.v0 |
HEALTHCHECK &{["CMD-SHELL" "curl --fail http://localhost:8800/api/3/action/status_show | exit CMD [\"/srv/app/start_ckan.sh\"]"] "1m0s" "5s" "0s" '\x05'} | |
CMD ["/srv/app/start_ckan.sh |
Info: https://github.com/ckan/ckan-docker/wiki/Replacing-DataPusher-with-XLoader
Once the use of the datapusher is deprecated (7db1611), several alternatives for loading structured data into the CKAN database (
datastore
) are proposed:ckanext-xloader
(in backgroundckan-xloader
container)[ ] Fix xloader API Token update in
CKAN_INI
. https://github.com/mjanez/ckan-docker/blob/38930eb029ea551cbdfa90657e6c62ec30055e34/ckan/docker-entrypoint.d/setup_xloader.sh#L1-L15[ ] Update
ckan/setup/supervisord
to include xloader worker in the background.supervisor.conf
supervisor.worker.conf
[ ] Update
setup/prerun.py
[ ] Update
setup/start_ckan.sh
Standalone container (
aircan
) with ckanext-aircan. [Preferred]