From 1eb9630aa5957e0be88131cecbef9f351783c0ce Mon Sep 17 00:00:00 2001 From: Brett Date: Tue, 12 Jul 2022 16:04:31 +0200 Subject: [PATCH] CKAN service updates --- .env | 1 + ckan/Dockerfile | 30 ++-------------------------- docker-compose.yml | 50 +++++++++++++++++++++++----------------------- 3 files changed, 28 insertions(+), 53 deletions(-) diff --git a/.env b/.env index 5ec8276..9637c38 100644 --- a/.env +++ b/.env @@ -23,6 +23,7 @@ TEST_CKAN_DATASTORE_WRITE_URL=postgresql://ckan:ckan@db/datastore_test TEST_CKAN_DATASTORE_READ_URL=postgresql://datastore_ro:datastore@db/datastore_test # CKAN core +CKAN_VERSION=2.9.5 CKAN_SITE_ID=default CKAN_SITE_URL=http://ckan:5000 CKAN_PORT=5000 diff --git a/ckan/Dockerfile b/ckan/Dockerfile index a123499..1d55f71 100644 --- a/ckan/Dockerfile +++ b/ckan/Dockerfile @@ -1,6 +1,4 @@ -FROM ckan/ckan-base:testing-only.2.9 - -LABEL maintainer="brett@kowh.ai" +FROM ckan/ckan-base:2.9.5 # Set up environment variables @@ -11,28 +9,4 @@ RUN echo ${TZ} > /etc/timezone # Make sure both files are not exactly the same RUN if ! [ /usr/share/zoneinfo/${TZ} -ef /etc/localtime ]; then \ cp /usr/share/zoneinfo/${TZ} /etc/localtime ;\ - fi ; - -# Install any extensions needed by your CKAN instance -# (Make sure to add the plugins to CKAN__PLUGINS in the .env file) -# For instance: -#RUN pip install -e git+https://github.com/ckan/ckanext-pages.git#egg=ckanext-pages && \ -# pip install -e git+https://github.com/ckan/ckanext-dcat.git@v0.0.6#egg=ckanext-dcat && \ -# pip install -r https://raw.githubusercontent.com/ckan/ckanext-dcat/v0.0.6/requirements.txt - -# Install the extension(s) you wrote for your own project -# RUN pip install -e git+https://github.com/your-org/ckanext-your-extension.git@v1.0.0#egg=ckanext-your-extension - -# Apply any patches needed to CKAN core or any of the built extensions (not the -# runtime mounted ones) -# See https://github.com/okfn/docker-ckan#applying-patches - -COPY patches ${APP_DIR}/patches - -RUN for d in ${APP_DIR}/patches/*; do \ - if [ -d $d ]; then \ - for f in `ls $d/*.patch | sort -g`; do \ - cd $SRC_DIR/`basename "$d"` && echo "$0: Applying patch $f to $SRC_DIR/`basename $d`"; patch -p1 < "$f" ; \ - done ; \ - fi ; \ - done + fi ; \ No newline at end of file diff --git a/docker-compose.yml b/docker-compose.yml index c6f3f55..ecc0d45 100755 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -19,31 +19,29 @@ services: ports: - "0.0.0.0:81:80" - #ckan: - # container_name: ckan - # build: - # context: ckan/ - # dockerfile: Dockerfile - # args: - # - TZ=${TZ} - # env_file: - # - .env - #depends_on: - # db: - # condition: service_healthy - # solr: - # condition: service_healthy - # redis: - # condition: service_healthy - # ports: - # - "0.0.0.0:${CKAN_PORT}:5000" - #volumes: - # - ckan_config:/etc/ckan - # - ckan_home:/usr/lib/ckan - # - ckan_storage:/var/lib/ckan - #restart: unless-stopped - #healthcheck: - # test: ["CMD", "wget", "-qO", "/dev/null", "http://localhost:5000"] + ckan: + container_name: ${CKAN_CONTAINER_NAME} + build: + context: ckan/ + dockerfile: Dockerfile + args: + - TZ=${TZ} + depends_on: + db: + condition: service_healthy + solr: + condition: service_healthy + redis: + condition: service_healthy + ports: + - "0.0.0.0:${CKAN_PORT}:5000" + volumes: + - ckan_config:/etc/ckan + - ckan_home:/usr/lib/ckan + - ckan_storage:/var/lib/ckan + restart: unless-stopped + healthcheck: + test: ["CMD", "wget", "-qO", "/dev/null", "http://localhost:5000"] datapusher: container_name: ${DATAPUSHER_CONTAINER_NAME} @@ -54,6 +52,8 @@ services: ports: - "8800:8800" restart: unless-stopped + healthcheck: + test: ["CMD", "wget", "-qO", "/dev/null", "http://localhost:8800"] db: container_name: ${POSTGRESQL_CONTAINER_NAME}