From 82ad95a0dd9e9996f98d0f0d0b7cd717974bad4c Mon Sep 17 00:00:00 2001 From: Brett Date: Fri, 18 Feb 2022 14:23:08 +0100 Subject: [PATCH 1/2] Consolidate the COPY commands --- images/ckan-base/2.7/Dockerfile | 8 +++----- images/ckan-base/2.8/Dockerfile | 8 +++----- images/ckan-base/2.9/Dockerfile | 9 +++------ 3 files changed, 9 insertions(+), 16 deletions(-) diff --git a/images/ckan-base/2.7/Dockerfile b/images/ckan-base/2.7/Dockerfile index 83b33c9..0904522 100755 --- a/images/ckan-base/2.7/Dockerfile +++ b/images/ckan-base/2.7/Dockerfile @@ -81,11 +81,9 @@ RUN addgroup -g 92 -S ckan && \ RUN mkdir -p $CKAN_STORAGE_PATH && \ chown -R ckan:ckan $CKAN_STORAGE_PATH -COPY 2.7/setup/ckan-uwsgi.ini ${APP_DIR} -COPY 2.7/setup/wsgi.py ${APP_DIR} -COPY 2.7/setup/prerun.py ${APP_DIR} -COPY 2.7/setup/start_ckan.sh ${APP_DIR} -COPY 2.7/setup/supervisord.conf /etc/supervisord.conf +# Copy setup files +COPY 2.7/setup ${APP_DIR} +RUN mv ${APP_DIR}/supervisord.conf /etc/supervisord.conf # Create entrypoint directory for children image scripts ONBUILD RUN mkdir /docker-entrypoint.d diff --git a/images/ckan-base/2.8/Dockerfile b/images/ckan-base/2.8/Dockerfile index e2cec51..09d8806 100755 --- a/images/ckan-base/2.8/Dockerfile +++ b/images/ckan-base/2.8/Dockerfile @@ -79,11 +79,9 @@ RUN addgroup -g 92 -S ckan && \ RUN mkdir -p $CKAN_STORAGE_PATH && \ chown -R ckan:ckan $CKAN_STORAGE_PATH -COPY 2.8/setup/ckan-uwsgi.ini ${APP_DIR} -COPY 2.8/setup/wsgi.py ${APP_DIR} -COPY 2.8/setup/prerun.py ${APP_DIR} -COPY 2.8/setup/start_ckan.sh ${APP_DIR} -COPY 2.8/setup/supervisord.conf /etc/supervisord.conf +# Copy setup files +COPY 2.8/setup ${APP_DIR} +RUN mv ${APP_DIR}/supervisord.conf /etc/supervisord.conf # Create entrypoint directory for children image scripts ONBUILD RUN mkdir /docker-entrypoint.d diff --git a/images/ckan-base/2.9/Dockerfile b/images/ckan-base/2.9/Dockerfile index a0d28d4..7879774 100755 --- a/images/ckan-base/2.9/Dockerfile +++ b/images/ckan-base/2.9/Dockerfile @@ -79,12 +79,9 @@ RUN pip3 install -e git+${GIT_URL}@${GIT_BRANCH}#egg=ckan && \ RUN pip3 install supervisor && \ mkdir /etc/supervisord.d -# Copy all setup files -COPY 2.9/setup/ckan-uwsgi.ini ${APP_DIR} -COPY 2.9/setup/wsgi.py ${APP_DIR} -COPY 2.9/setup/prerun.py ${APP_DIR} -COPY 2.9/setup/start_ckan.sh ${APP_DIR} -COPY 2.9/setup/supervisord.conf /etc/supervisord.conf +# Copy setup files +COPY 2.9/setup ${APP_DIR} +RUN mv ${APP_DIR}/supervisord.conf /etc/supervisord.conf # Create a local user and group to run the app RUN addgroup -g 92 -S ckan && \ From 28f690123881695fe81d69a3fe8d62805088ee12 Mon Sep 17 00:00:00 2001 From: Brett Date: Wed, 1 Jun 2022 09:56:25 +0200 Subject: [PATCH 2/2] Update README.txt --- README.txt | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) diff --git a/README.txt b/README.txt index 022f23c..70d1f75 100644 --- a/README.txt +++ b/README.txt @@ -31,3 +31,36 @@ Use a bind mount for the config file (ckan.ini) -d ckan-docker_ckan Maybe include a script to replace docker-compose if required + +Dev Mode (OKFN) + +The differences between Docker dev abd Docker base is as the following: + +docker-compose.dev.yml + solr: explicitly puts in ports (8983:8983) + db: Doesn't pass in environment and arg values + ckan: has extra volume bind mount (./src:/srv/app/src_extensions) + +Dockerfile.dev + Takes the base image and + Adds a new directory (SRC_EXTENSIONS_DIR=/srv/app/src_extensions) + installs libffi-dev + installs dev-requirements.txt + runs different start script (start_ckan_development.sh) which installs any extension located in SRC_EXTENSIONS_DIR + runs a typical Dev install + pip install -r pip-requirements.txt + pip install -r requirements.txt + pip install -r dev-requirements.txt + python3 setup.py develop + ckan config-tool test.ini + ckan config-tool $CKAN_INI -s DEFAULT "debug = true" + ckan config-tool $CKAN_INI "ckan.plugins = $CKAN__PLUGINS" + ckan config-tool $SRC_DIR/ckan/test-core.ini \ + "sqlalchemy.url = $TEST_CKAN_SQLALCHEMY_URL" \ + "ckan.datastore.write_url = $TEST_CKAN_DATASTORE_WRITE_URL" \ + "ckan.datastore.read_url = $TEST_CKAN_DATASTORE_READ_URL" \ + "solr_url = $TEST_CKAN_SOLR_URL" \ + "ckan.redis.url = $TEST_CKAN_REDIS_URL" + + All other steps are similar to the base Dockerfile +