Browse Source

update nextcloud image to use with face recognize app

master
Markus Bergholz 8 months ago
parent
commit
a5e8bcf732
1 changed files with 73 additions and 9 deletions
  1. +73
    -9
      docker/nextcloud/Dockerfile

+ 73
- 9
docker/nextcloud/Dockerfile View File

@ -1,14 +1,78 @@
FROM nextcloud:17.0.0
#
# Use a temporary image to compile and test the libraries
#
FROM nextcloud:19.0.1 as builder
RUN apt update && apt upgrade -y && apt install libgmp-dev libmagickwand-dev -y && apt clean
# Build and install dlib on builder
RUN docker-php-ext-install gmp
RUN docker-php-ext-enable imagick
RUN apt-get update ; \
apt-get install -y build-essential wget cmake libx11-dev libopenblas-dev
ARG DLIB_BRANCH=v19.19
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 --config Release .. \
&& make \
&& make install
# Build and install PDLib on builder
ARG PDLIB_BRANCH=master
RUN apt-get install unzip
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 necesary 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 instalation on builer
RUN apt-get install -y git
RUN git clone https://github.com/matiasdelellis/pdlib-min-test-suite.git \
&& cd pdlib-min-test-suite \
&& make
#
# If pass the tests, we are able to create the final image.
#
FROM nextcloud:19.0.1
# Install dependencies to image
RUN apt-get update ; \
apt-get install -y libopenblas-base
# 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-20190902/pdlib.so /usr/local/lib/php/extensions/no-debug-non-zts-20190902/
# 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=1024M > /usr/local/etc/php/conf.d/memory-limit.ini
#RUN sed -i 's/LogFormat "%h/LogFormat "%{X-Forwarded-For}i,%h/' /etc/apache2/apache2.conf
# change log format to json
#RUN sed -i '/combined/d' /etc/apache2/apache2.conf
#RUN echo 'LogFormat "{ \"time\":\"%{%Y-%m-%d}tT%{%T}t.%{msec_frac}tZ\", \"remoteIP\":\"%{X-Forwarded-For}i\", \"request\":\"%U\", \"query\":\"%q\", \"method\":\"%m\", \"status\":\"%>s\", \"userAgent\":\"%{User-agent}i\", \"referer\":\"%{Referer}i\" }" combined' >> /etc/apache2/apache2.conf
#RUN echo 'LogFormat "{ \"time\":\"%{%Y-%m-%d}tT%{%T}t.%{msec_frac}tZ\", \"remoteIP\":\"%{X-Forwarded-For}i\", \"request\":\"%U\", \"query\":\"%q\", \"method\":\"%m\", \"status\":\"%>s\", \"userAgent\":\"%{User-agent}i\", \"referer\":\"%{Referer}i\" }" vhost_combined' >> /etc/apache2/apache2.conf
RUN sed -i 's/LogFormat "%h/LogFormat "%{X-Forwarded-For}i/' /etc/apache2/apache2.conf
RUN apt update && apt install -y libbz2-dev
RUN docker-php-ext-install bz2

Loading…
Cancel
Save