A single-container deployment of IIPImage, running on nginx with FastCGI.
(Forked from iiip-nginx-single.)
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.
To build and run the container based on the configuration in
docker-compose.yml:
docker-compose build --pull
docker-compose upNote that nginx/IIPImage runs on port 80, and is exposed on host port 80.
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 value to
the container; see below under "Custom configuration".
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/2/context.json",
"@id" : "http://localhost/iiif/test.tif",
"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 ] }
],
"profile" : [
"http://iiif.io/api/image/2/level1.json",
{ "formats" : [ "jpg" ],
"qualities" : [ "native","color","gray","bitonal" ],
"supports" : ["regionByPct","regionSquare","sizeByForcedWh","sizeByWh","sizeAboveFull","rotationBy90s","mirroring"],
"maxWidth" : 5000,
"maxHeight" : 5000
}
]
}You also can build an image directly from the Dockerfile and point it at an external image directory.
docker build . -t iipsrv:latestThis 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:latestNote: FILESYSTEM_PREFIX must have a trailing slash.
This runs the image built above with the following configuration:
- serving images from a host directory
/tmp/iipsrv-images, mounted as/imagesin the container directory - sending CORS header
Access-Control-Allow-Origin: * - publishing container port 80 (the IIPImage/nginx port) to port 80 on 127.0.0.1