-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathDockerfile
More file actions
96 lines (70 loc) · 2.82 KB
/
Dockerfile
File metadata and controls
96 lines (70 loc) · 2.82 KB
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
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
FROM nextcloud:31.0.8-apache AS builder
# Build and install libraries on builder
RUN apt-get update && \
apt-get install ffmpeg -y && \
apt-get install -y build-essential wget cmake libx11-dev libopenblas-dev nodejs unzip && \
rm -rf /var/lib/apt/lists/*
ARG DLIB_BRANCH=v19.24
RUN wget -c -q https://github.com/davisking/dlib/archive/$DLIB_BRANCH.tar.gz \
&& tar xf $DLIB_BRANCH.tar.gz \
&& mv dlib-* dlib \
&& cd dlib/dlib \
&& mkdir build \
&& cd build \
&& cmake -DBUILD_SHARED_LIBS=ON .. \
&& make \
&& make install
# Build and install PDLib on builder
ARG PDLIB_BRANCH=v1.1.0
RUN wget -c -q https://github.com/matiasdelellis/pdlib/archive/$PDLIB_BRANCH.zip \
&& unzip $PDLIB_BRANCH \
&& mv pdlib-* pdlib \
&& cd pdlib \
&& phpize \
&& ./configure \
&& make \
&& make install
# Enable PDlib on builder
# If necessary take the php settings folder uncommenting the next line
#RUN php -i | grep "Scan this dir for additional .ini files"
RUN echo "extension=pdlib.so" > /usr/local/etc/php/conf.d/pdlib.ini
# Test PDlib installation on builder
RUN apt-get update && \
apt-get install -y git && \
rm -rf /var/lib/apt/lists/*
RUN git clone https://github.com/matiasdelellis/pdlib-min-test-suite.git \
&& cd pdlib-min-test-suite \
&& make
#
# If we pass the tests, we are able to create the final image.
#
FROM nextcloud:31.0.8-apache
# Install dependencies to image
RUN apt-get update ; \
apt-get install -y libopenblas-dev libopenblas0 libopenblas64-0
# Install dlib and PDlib to image
COPY --from=builder /usr/local/lib/libdlib.so* /usr/local/lib/
# If is necesary take the php extention folder uncommenting the next line
RUN php -i | grep extension_dir
COPY --from=builder /usr/local/lib/php/extensions/no-debug-non-zts-20230831/pdlib.so /usr/local/lib/php/extensions/no-debug-non-zts-20230831/
# Enable PDlib on final image
RUN echo "extension=pdlib.so" > /usr/local/etc/php/conf.d/pdlib.ini
# Increse memory limits
RUN echo memory_limit=2048M > /usr/local/etc/php/conf.d/memory-limit.ini
# Pdlib is already installed, now without all build dependencies.
# You could test again if everything is correct, uncommenting the next lines
#
RUN apt-get install -y git wget
RUN git clone https://github.com/matiasdelellis/pdlib-min-test-suite.git \
&& cd pdlib-min-test-suite \
&& make
#
# At this point you meet all the dependencies to install the application
# If is available you can skip this step and install the application from the application store
RUN apt-get update && apt-get install -y libbz2-dev ffmpeg && \
docker-php-ext-install bz2 && \
rm -rf /var/lib/apt/lists/*
RUN apt-get update && \
apt-get install -y wget unzip nodejs npm aria2 python3-pip && \
rm -rf /var/lib/apt/lists/*
RUN pip install tensorflow --break-system-packages