-
Notifications
You must be signed in to change notification settings - Fork 19
/
Dockerfile
66 lines (47 loc) · 1.99 KB
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
FROM ubuntu:16.04
MAINTAINER [email protected]
ENV HOME /root
# Update packages and install tools
RUN apt-get update -y && apt-get install -y wget git unzip
# Install pip and python libs
RUN apt-get install -y python-dev python-setuptools python-pip
RUN pip install --upgrade pip
RUN pip2.7 install Werkzeug
RUN pip2.7 install configobj
# Install kakadu
WORKDIR /usr/local/lib
RUN wget --no-check-certificate https://github.com/loris-imageserver/loris/raw/development/lib/Linux/x86_64/libkdu_v74R.so \
&& chmod 755 libkdu_v74R.so
WORKDIR /usr/local/bin
RUN wget --no-check-certificate https://github.com/loris-imageserver/loris/raw/development/bin/Linux/x86_64/kdu_expand \
&& chmod 755 kdu_expand
RUN ln -s /usr/lib/`uname -i`-linux-gnu/libfreetype.so /usr/lib/ \
&& ln -s /usr/lib/`uname -i`-linux-gnu/libjpeg.so /usr/lib/ \
&& ln -s /usr/lib/`uname -i`-linux-gnu/libz.so /usr/lib/ \
&& ln -s /usr/lib/`uname -i`-linux-gnu/liblcms.so /usr/lib/ \
&& ln -s /usr/lib/`uname -i`-linux-gnu/libtiff.so /usr/lib/ \
RUN echo "/usr/local/lib" >> /etc/ld.so.conf && ldconfig
# Install Pillow
RUN apt-get install -y libjpeg8 libjpeg8-dev libfreetype6 libfreetype6-dev zlib1g-dev liblcms2-2 liblcms2-dev liblcms2-utils libtiff5-dev
RUN pip2.7 install Pillow
# Install loris
WORKDIR /opt
# Get loris and unzip.
RUN wget --no-check-certificate https://github.com/loris-imageserver/loris/archive/v2.1.0-final.zip \
&& unzip loris-2.1.0-final.zip \
&& mv loris-2.1.0-final/ loris/ \
&& rm loris-2.1.0-final.zip
RUN useradd -d /var/www/loris -s /sbin/false loris
WORKDIR /opt/loris
# Create image directory
RUN mkdir /usr/local/share/images
# Load example images
RUN cp -R tests/img/* /usr/local/share/images/
RUN ./setup.py install
COPY loris2.conf etc/loris2.conf
WORKDIR /opt/loris/loris
# bind test server to 0.0.0.0
RUN sed -i -- 's/localhost/0.0.0.0/g' webapp.py
RUN sed -i 's/app = create_app(debug=True)/app = create_app(debug=False, config_file_path=conf_fp)/g' webapp.py
EXPOSE 5004
CMD ["python", "webapp.py"]