Skip to content

A single-container deployment of IIPImage

License

Notifications You must be signed in to change notification settings

BerkeleyLibrary/iipsrv

Repository files navigation

iipsrv

A single-container deployment of IIPImage, running on nginx with FastCGI.

Configuration

When using this image, either on its own or with the included docker-compose.yml, take note of the following environment variables:

Variable Purpose Default Notes
FILESYSTEM_PREFIX path to the image file directory none (but see below under "Image files") must include trailing slash
LOGFILE IIPImage log output /dev/stdout (in Dockerfile)
CORS CORS Access-Control-Allow-Origin header value * (in docker-compose.yml; none in Dockerfile)

See the IIPImage docs for a full list of environment variables.

In addition, the Dockerfile uses the IIPSRV_VERSION and IIPSRV_BUILD_REF build arguments to specify the version of IIPImage to compile for the image. IIP_VERSION assumes Git tags of the format iipsrv-${IIP_VERSION} are being created upstream; IIPSRV_BUILD_REF is used to specify an alternate branch or tag name that may not be in this format.

Notes for developers

Default development configuration

Building and running

To build and run the container based on the configuration in docker-compose.yml:

docker-compose build --pull
docker-compose up

Note that nginx/IIPImage runs on port 80, and is exposed on host port 80.

Image files

By default, the iipsrv-entrypoint.sh script will cause files to be served from the test/data directory.

You can override this mount by passing a $FILESYSTEM_PREFIX value to the container; see below under "Custom configuration".

Testing

To test that the container has come up correctly, using the image file test/data/test.tif:

curl -v 'http://localhost/iiif/test.tif/info.json'

This should produce a IIIF information response in JSON format, e.g.:

{
  "@context" : "http://iiif.io/api/image/3/context.json",
  "protocol" : "http://iiif.io/api/image",
  "width" : 2769,
  "height" : 3855,
  "sizes" : [
     { "width" : 173, "height" : 240 },
     { "width" : 346, "height" : 481 },
     { "width" : 692, "height" : 963 },
     { "width" : 1384, "height" : 1927 }
  ],
  "tiles" : [
     { "width" : 256, "height" : 256, "scaleFactors" : [ 1, 2, 4, 8, 16 ] }
  ],
  "id" : "http://localhost/iiif/test.tif",
  "type": "ImageService3",
  "profile" : "level1",
  "maxWidth" : 5000,
  "maxHeight" : 5000,
  "extraQualities": ["color","gray","bitonal"],
  "extraFormats": ["tif","webp"],
  "extraFeatures": ["regionByPct","sizeByPct","sizeByConfinedWh","sizeUpscaling","rotationBy90s","mirroring"],
  "service": [
    {
      "@context": "http://iiif.io/api/annex/services/physdim/1/context.json",
      "profile": "http://iiif.io/api/annex/services/physdim",
      "physicalScale": 0.00846667,
      "physicalUnits": "cm"
    }
  ]

}

Custom configuration

You also can build an image directly from the Dockerfile and point it at an external image directory.

docker build . -t iipsrv:latest

This builds an image and tag it iipsrv:latest.

docker run --rm \
  --volume /tmp/iipsrv-images:/images \
  --env FILESYSTEM_PREFIX=/images/ \
  --env CORS='*' \
  --publish 127.0.0.1:80:80 \
  iipsrv:latest

Note: FILESYSTEM_PREFIX must have a trailing slash.

This runs the image built above with the following configuration:

  1. serving images from a host directory /tmp/iipsrv-images, mounted as /images in the container directory
  2. sending CORS header Access-Control-Allow-Origin: *
  3. publishing container port 80 (the IIPImage/nginx port) to port 80 on 127.0.0.1

About

A single-container deployment of IIPImage

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors 3

  •  
  •  
  •