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

Docker compose setup with nginx+iipsrv+memcached

parent 776371f3
No related branches found
No related tags found
No related merge requests found
---
version: '3'
services:
# Our own build of IIPsrv
iipsrv:
build: iipsrv
depends_on:
- memcached
links:
- memcached
# Nginx server as a gateway to iipsrv FCGI
nginx:
build: nginx
ports:
- "8000:80"
depends_on:
- iipsrv
links:
- iipsrv
# iipsrv cache
memcached:
image: memcached:alpine
FROM debian
MAINTAINER Bastien Abadie, NextCairn <bastien@nextcairn.com>
RUN apt-get update -y
#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
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
RUN make
RUN make install
RUN mkdir -p /usr/local/bin
RUN cp ./src/iipsrv.fcgi /usr/local/bin/iipsrv
RUN chmod a+rx /usr/local/bin/iipsrv
# Cleanup
WORKDIR /root
RUN rm -rf /tmp/iipsrv
# Run image server
ENV "LOGFILE" "/var/log/iipsrv.log"
ENV "VERBOSITY" "1"
ENV "MEMCACHED_SERVERS" "memcached"
CMD ["/usr/local/bin/iipsrv", "--bind", "127.0.0.1:9000"]
FROM nginx
EXPOSE 80
ENV NGINX_PORT 80
RUN rm /etc/nginx/conf.d/default.conf
COPY proxy.conf /etc/nginx/conf.d/proxy.conf
CMD nginx -g 'daemon off;'
server {
listen 80;
location / {
fastcgi_pass iipsrv:9000;
fastcgi_param PATH_INFO $fastcgi_script_name;
fastcgi_param REQUEST_METHOD $request_method;
fastcgi_param QUERY_STRING $query_string;
fastcgi_param CONTENT_TYPE $content_type;
fastcgi_param CONTENT_LENGTH $content_length;
fastcgi_param SERVER_PROTOCOL $server_protocol;
fastcgi_param REQUEST_URI $request_uri;
fastcgi_param HTTPS $https if_not_empty;
}
}
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