|
| 1 | +# IIPImage Dockerfile based on Debian Linux |
| 2 | +# |
| 3 | +# iipsrv: latest stable version from IIPImage apt repository |
| 4 | +# - installs keyring and iipsrv apt package |
| 5 | +# - starts HTTP and FCGI services |
| 6 | +# - reads images from /images/ |
| 7 | +# - provides /fcgi-bin/iipsrv.fcgi and /iiif/ endpoints |
| 8 | +# |
| 9 | + |
| 10 | +FROM debian:stable-slim |
| 11 | +ENV DEBIAN_FRONTEND=noninteractive |
| 12 | + |
| 13 | +LABEL MAINTAINER=ruven@users.sourceforge.net |
| 14 | +LABEL url="https://iipimage.sourceforge.io" |
| 15 | +LABEL author="Ruven <ruven@users.sourceforge.net>" |
| 16 | +EXPOSE 80 9000 |
| 17 | + |
| 18 | + |
| 19 | +# Install build dependencies |
| 20 | +RUN apt-get update && \ |
| 21 | + apt-get install --no-install-recommends -y \ |
| 22 | + ca-certificates \ |
| 23 | + media-types \ |
| 24 | + lighttpd \ |
| 25 | + apt-transport-https && \ |
| 26 | + update-ca-certificates |
| 27 | + |
| 28 | + |
| 29 | +# Install keyring and iipsrv |
| 30 | +COPY iipimage-keyring_1.0.0-1+trixie_all.deb /tmp/ |
| 31 | +RUN dpkg -i /tmp/iipimage-keyring_1.0.0-1+trixie_all.deb && \ |
| 32 | + apt-get update && \ |
| 33 | + apt-get install --no-install-recommends -y iipimage-server |
| 34 | + |
| 35 | + |
| 36 | +# Append lighttpd configuration to enable FCGI proxy forwarding to iipsrv |
| 37 | +RUN env echo -e 'server.modules += ("mod_fastcgi")\n\ |
| 38 | +fastcgi.server = (\n\ |
| 39 | + "/fcgi-bin/iipsrv.fcgi" => (("host"=>"0.0.0.0","port"=>9000,"check-local"=>"disable")),\n\ |
| 40 | + "/iiif/" => (("host"=>"0.0.0.0","port"=>9000,"check-local"=>"disable"))\n\ |
| 41 | +)' >> /etc/lighttpd/conf-enabled/iipsrv.conf |
| 42 | + |
| 43 | + |
| 44 | +# Create startup script which starts both lighttpd and iipsrv |
| 45 | +RUN env echo -e "#!/bin/sh\n\ |
| 46 | +lighttpd -f /etc/lighttpd/lighttpd.conf \n\ |
| 47 | +iipsrv --bind \${HOST}:\${PORT}" > /usr/local/bin/run &&\ |
| 48 | +chmod u+x /usr/local/bin/run |
| 49 | + |
| 50 | + |
| 51 | +# Set iipsrv environment defaults and execute startup script |
| 52 | +ENV HOST="0.0.0.0" PORT="9000" LOGFILE="/dev/stdout" URI_MAP="iiif=>IIIF" VERBOSITY=6 FILESYSTEM_PREFIX="/images/" |
| 53 | +ENTRYPOINT ["run"] |
0 commit comments