Skip to content

Commit

Permalink
now with iif
Browse files Browse the repository at this point in the history
  • Loading branch information
rnsrk committed Dec 17, 2024
1 parent 8274004 commit 5cb9168
Show file tree
Hide file tree
Showing 3 changed files with 68 additions and 1 deletion.
36 changes: 35 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,32 @@ LABEL org.opencontainers.image.description="Plain Drupal with preinstalled Site

RUN apt-get update; \
apt-get install -y --no-install-recommends \
apt-utils \
autoconf \
automake \
default-mysql-client \
git \
iipimage-server \
iipimage-doc \
imagemagick \
libapache2-mod-fcgid \
libfreetype6-dev \
libjpeg-dev \
libjpeg62-turbo \
libonig-dev \
libpng-dev \
libpng16-16 \
libpq-dev \
libtiff-dev \
libtiff5-dev \
libtool \
libvips-dev \
libvips-tools \
libzip-dev \
openjdk-17-jdk \
unzip \
vim \
wget
wget;

# Upload progress
RUN set -eux; \
Expand All @@ -24,6 +45,19 @@ RUN set -eux; \
RUN set -eux; \
pecl install apcu;

# Install iipsrv
RUN set -eux; \
git clone https://github.com/ruven/iipsrv.git; \
cd iipsrv; \
./autogen.sh; \
./configure; \
make; \
mkdir /fcgi-bin; \
cp src/iipsrv.fcgi /fcgi-bin/iipsrv.fcgi

# Add IIPServer config
COPY iipsrv.conf /etc/apache2/mods-available/iipsrv.conf

# Add php configs
RUN { \
echo 'extension=apcu.so'; \
Expand Down
10 changes: 10 additions & 0 deletions entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,16 @@ else
drush cr
} 1> /dev/null
echo -e "\033[0;32mWISSKI ${FLAVOUR} RECIPE APPLIED.\033[0m\n"

# Set IIP server config
if [ "${FLAVOUR}" == "fruity" ]; then
echo -e "\033[0;33mDownload Mirador integration library.\033[0m"
drush wisski-mirador:wisski-mirador-integration
echo -e "\033[0;32mMirador integration library downloaded.\033[0m\n"
echo -e "\033[0;33mSet IIIF configs.\033[0m"
drush config-set wisski_iip_image.wisski_iiif_settings iiif_server "https://${DOMAIN}/fcgi-bin/iipsrv.fcgi?IIIF="
echo -e "\033[0;32mIIIF configs set.\033[0m\n"
fi
done

# set recommended PHP.ini settings
Expand Down
23 changes: 23 additions & 0 deletions iipsrv.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
<IfModule mod_fcgid.c>
ScriptAlias /fcgi-bin/ "/fcgi-bin/"
<Location "/fcgi-bin/">
Options None
Require all granted
<IfModule mod_mime.c>
AddHandler fcgid-script .fcgi
</IfModule>
</Location>
# Set our environment variables for the IIP server
FcgidInitialEnv VERBOSITY "1"
FcgidInitialEnv LOGFILE "/var/log/iipsrv.log"
FcgidInitialEnv MAX_IMAGE_CACHE_SIZE "10"
FcgidInitialEnv JPEG_QUALITY "90"
FcgidInitialEnv MAX_CVT "5000"
FcgidInitialEnv MEMCACHED_SERVERS "localhost"

# Define the idle timeout as unlimited and the number of
# processes we want
FcgidConnectTimeout 20
FcgidIdleTimeout 0
FcgidMaxProcessesPerClass 1
</IfModule>

0 comments on commit 5cb9168

Please sign in to comment.