From f9ebc0c41c1bda1bfac992d5687e15c81e2c5e80 Mon Sep 17 00:00:00 2001 From: amercader Date: Tue, 17 Oct 2023 12:21:50 +0200 Subject: [PATCH] Add step to copy init files Always copy the files in /docker-entrypoint.d automatically, otherwise users need to explicitly add a `COPY` step in the `ckan/Dockerfile`, which is confusing --- ckan/Dockerfile | 4 ++++ ckan/Dockerfile.dev | 4 +++- ckan/docker-entrypoint.d/README.md | 4 ++++ 3 files changed, 11 insertions(+), 1 deletion(-) create mode 100644 ckan/docker-entrypoint.d/README.md diff --git a/ckan/Dockerfile b/ckan/Dockerfile index 8f0532e7..5af0f600 100644 --- a/ckan/Dockerfile +++ b/ckan/Dockerfile @@ -5,6 +5,10 @@ ENV APP_DIR=/srv/app ENV TZ=UTC RUN echo ${TZ} > /etc/timezone + +# Copy custom initialization scripts +COPY docker-entrypoint.d/* /docker-entrypoint.d/ + # 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 ;\ diff --git a/ckan/Dockerfile.dev b/ckan/Dockerfile.dev index 1720f718..b4cdc65d 100644 --- a/ckan/Dockerfile.dev +++ b/ckan/Dockerfile.dev @@ -44,9 +44,11 @@ RUN if ! [ /usr/share/zoneinfo/${TZ} -ef /etc/localtime ]; then \ # Clone the extension(s) your are writing for your own project in the `src` folder # to get them mounted in this image at runtime +# Copy custom initialization scripts +COPY docker-entrypoint.d/* /docker-entrypoint.d/ + # Apply any patches needed to CKAN core or any of the built extensions (not the # runtime mounted ones) - COPY patches ${APP_DIR}/patches RUN for d in $APP_DIR/patches/*; do \ diff --git a/ckan/docker-entrypoint.d/README.md b/ckan/docker-entrypoint.d/README.md new file mode 100644 index 00000000..27fa2922 --- /dev/null +++ b/ckan/docker-entrypoint.d/README.md @@ -0,0 +1,4 @@ +Use scripts in this folder to run extra initialization steps in your custom CKAN images. +Any file with `.sh` or `.py` extension will be executed just after the main initialization +script (`prerun.py`) is executed and just before the web server and supervisor processes are +started.