Skip to content
Snippets Groups Projects
Commit 918a19fd authored by Bastien Abadie's avatar Bastien Abadie
Browse files

Working IIPSrv

parent fb3c2a6b
No related branches found
No related tags found
No related merge requests found
---
version: '3'
version: "3.2"
services:
# Our own build of IIPsrv
......@@ -9,22 +9,26 @@ services:
depends_on:
- memcached
links:
- memcached
volumes:
- type: volume
source: ./logs
target: /var/log
- type: bind
source: ./images
target: /images
# Nginx server as a gateway to iipsrv FCGI
nginx:
build: nginx
ports:
- "8000:80"
# Conatiner's 80 is available on host 9000
- "9000:80"
depends_on:
- iipsrv
links:
- iipsrv
# iipsrv cache
memcached:
image: memcached:alpine
......@@ -2,31 +2,15 @@ FROM debian
MAINTAINER Bastien Abadie, NextCairn <bastien@nextcairn.com>
# Install dependencies
RUN apt-get update -y
RUN apt-get install -y libtiff5 zlib1g libmemcached11 nginx autoconf make build-essential wget tar libtool pkg-config libmemcached-dev libopenjp2-7-dev memcached libjpeg62-turbo libjpeg62-turbo-dev libtiff5 libtiff5-dev libpng16-16 libpng-dev liblcms2-2 liblcms2-dev libgomp1 libpthread-stubs0-dev liblzma5 liblzma-dev libjbig-dev libjbig0 libz80ex1 libz80ex-dev
#Requirements: libtiff, zlib and the IJG JPEG development libraries. Optional: libmemcached (for Memcached) and Kakadu or OpenJPEG (for JPEG2000).
# Merge those lines
RUN apt install -y libtiff5 zlib1g libmemcached11 nginx libopenjp2-7
RUN apt-get install -y autoconf make
RUN apt-get install -y build-essential
RUN apt-get install -y wget tar
# Download iipsrc source code
WORKDIR /tmp/iipsrv
RUN wget https://github.com/ruven/iipsrv/archive/master.tar.gz
RUN tar xvzf master.tar.gz --strip-components=1
# Merge with above apt lines
RUN apt-get install -y libtool
RUN apt-get install -y libjpeg-dev
RUN apt-get install -y libtiff-dev
RUN apt-get install -y pkg-config
RUN apt-get install -y libmemcached-dev
RUN apt-get install -y libopenjp2-7-dev
# Compile & install
RUN ./autogen.sh
RUN ./configure --enable-openjpeg
......@@ -40,9 +24,14 @@ RUN chmod a+rx /usr/local/bin/iipsrv
WORKDIR /root
RUN rm -rf /tmp/iipsrv
VOLUME "/var/log"
VOLUME "/images"
# Run image server
ENV "LOGFILE" "/var/log/iipsrv.log"
ENV "VERBOSITY" "1"
ENV "VERBOSITY" "1000"
ENV "MEMCACHED_SERVERS" "memcached"
ENV "FILESYSTEM_PREFIX" "/images/"
CMD ["/usr/local/bin/iipsrv", "--bind", "127.0.0.1:9000"]
EXPOSE 9000
CMD ["/usr/local/bin/iipsrv", "--bind", "0.0.0.0:9000"]
upstream iip {
server iipsrv:9000;
}
server {
listen 80;
location / {
location / {
add_header "Content-Type" "text/plain";
return 200 "Horae";
}
fastcgi_pass iipsrv:9000;
fastcgi_param PATH_INFO $fastcgi_script_name;
location /images {
fastcgi_param PATH_INFO /iipsrv.fcgi; #$fastcgi_script_name;
fastcgi_param REQUEST_METHOD $request_method;
fastcgi_param QUERY_STRING $query_string;
fastcgi_param CONTENT_TYPE $content_type;
......@@ -12,5 +19,8 @@ server {
fastcgi_param SERVER_PROTOCOL $server_protocol;
fastcgi_param REQUEST_URI $request_uri;
fastcgi_param HTTPS $https if_not_empty;
# Forward to iipsrv instance
fastcgi_pass iip;
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment