2024-03-20 14:01:31 +01:00
|
|
|
FROM ghcr.io/mjanez/ckan-docker:ckan-2.9.11
|
2023-09-28 13:36:09 +02:00
|
|
|
LABEL maintainer="mnl.janez@gmail.com"
|
2023-04-20 13:20:33 +02:00
|
|
|
|
|
|
|
# Set up environment variables
|
|
|
|
ENV APP_DIR=/srv/app
|
|
|
|
ENV TZ=UTC
|
2023-09-28 13:36:09 +02:00
|
|
|
|
|
|
|
# Set working directory
|
|
|
|
WORKDIR ${APP_DIR}
|
2023-04-20 13:20:33 +02:00
|
|
|
|
|
|
|
# Make sure both files are not exactly the same
|
2023-09-28 13:36:09 +02:00
|
|
|
RUN echo ${TZ} > /etc/timezone && \
|
|
|
|
if ! [ /usr/share/zoneinfo/${TZ} -ef /etc/localtime ]; then \
|
|
|
|
cp /usr/share/zoneinfo/${TZ} /etc/localtime ; \
|
2023-04-20 13:20:33 +02:00
|
|
|
fi ;
|
|
|
|
|
|
|
|
# Used to configure the container environment by setting environment variables, creating users, running initialization scripts, .etc
|
2023-09-28 13:36:09 +02:00
|
|
|
COPY docker-entrypoint.d/* docker-entrypoint.d/
|
2023-04-20 13:20:33 +02:00
|
|
|
|
2023-07-26 10:25:03 +02:00
|
|
|
# Update who.ini with PROXY_CKAN_LOCATION
|
2023-09-28 13:36:09 +02:00
|
|
|
COPY setup/who.ini ./
|
2023-04-20 13:20:33 +02:00
|
|
|
|
|
|
|
# Apply any patches needed to CKAN core
|
2023-10-02 09:41:25 +02:00
|
|
|
COPY patches patches
|
2023-04-20 13:20:33 +02:00
|
|
|
|
|
|
|
# Updated version of the Dockerfile RUN command that skips applying a patch if a reversed or previously applied patch is detected
|
|
|
|
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"` && \
|
|
|
|
if patch -R --dry-run -p1 < "$f"; then \
|
|
|
|
echo "$0: Patch $f has already been applied or reversed, skipping..."; \
|
|
|
|
else \
|
|
|
|
echo "$0: Applying patch $f to $SRC_DIR/`basename $d`"; \
|
2024-04-12 14:49:05 +02:00
|
|
|
sed -i 's/\r$//' "$f" && \
|
2023-04-20 13:20:33 +02:00
|
|
|
patch -p1 < "$f" ; \
|
|
|
|
fi \
|
|
|
|
done ; \
|
|
|
|
fi ; \
|
|
|
|
done
|
|
|
|
|
2024-03-08 21:31:08 +01:00
|
|
|
# Workers
|
|
|
|
## Update start_ckan.sh with custom workers
|
|
|
|
COPY setup/start_ckan.sh.override ${APP_DIR}/start_ckan.sh
|
|
|
|
RUN chmod +x ${APP_DIR}/start_ckan.sh
|
|
|
|
|
|
|
|
## Load workers supervisor configuration
|
|
|
|
COPY setup/workers/* /etc/supervisord.d/
|
|
|
|
|
|
|
|
# Start CKAN
|
2023-09-28 13:36:09 +02:00
|
|
|
CMD ["/bin/sh", "-c", "$APP_DIR/start_ckan.sh"]
|