nextcloud/Dockerfile
2022-11-05 19:01:07 +05:00

114 lines
3.7 KiB
Docker

FROM debian:11-slim
WORKDIR /root
ARG PHPVERSION=7.4
SHELL ["/bin/bash", "-c"]
#Initial update packges
RUN apt update && apt upgrade -y
# Language setup
ENV LANG en_US.UTF-8
ENV LANGUAGE en_US:en
ENV LC_ALL en_US.UTF-8
RUN apt install locales -y \
&& apt auto-remove -y \
&& apt clean -y
RUN sed -i '/en_US.UTF-8/s/^# //g' /etc/locale.gen \
&& locale-gen
# Installing basic tools
RUN apt install bzip2 zip unzip git gnupg2 ca-certificates lsb-release apt-transport-https wget curl nano vim -y --no-install-recommends \
&& apt auto-remove -y \
&& apt clean -y
#Download and extract Nextcloud....
RUN wget https://download.nextcloud.com/server/releases/latest.tar.bz2 \
&& tar -xvf latest.tar.bz2 \
&& rm -v latest.tar.bz2
# Installing and configuring nginx
RUN apt install nginx -y --no-install-recommends \
&& apt auto-remove -y \
&& apt clean -y
# Installing redis
RUN apt install redis -y --no-install-recommends \
&& apt auto-remove -y \
&& apt clean -y
#Adding Repo
RUN wget https://packages.sury.org/php/apt.gpg \
&& apt-key add apt.gpg \
&& rm apt.gpg \
&& echo "deb https://packages.sury.org/php/ $(lsb_release -sc) main" > /etc/apt/sources.list.d/php.list \
&& apt update
#Installing and configure PHP
RUN apt install php${PHPVERSION}-fpm php${PHPVERSION} -y --no-install-recommends \
&& mkdir /run/php/
#Installing Required PHP Modules
RUN apt install -y php${PHPVERSION}-{cli,bcmath,bz2,intl,common,ctype,curl,dom,gd,mbstring,posix,simplexml,xmlreader,xmlwriter,zip} --no-install-recommends
#Installing database connector PHP Modules
RUN apt install -y php${PHPVERSION}-mysql --no-install-recommends
#Installing recommended PHP Modules
RUN apt install -y php${PHPVERSION}-{fileinfo,bz2,intl} --no-install-recommends
#Installing Optional Specific app PHP Modules
RUN apt install -y php${PHPVERSION}-{gmp,exif} --no-install-recommends
#Installing Optional server performance enhancement PHP Modules
RUN apt install -y php${PHPVERSION}-{apcu,memcached,redis} --no-install-recommends
#Installing optional PHP modules and tools for preview generation #Maybe add LibreOffice here
RUN apt install -y php${PHPVERSION}-imagick imagemagick ffmpeg libreoffice --no-install-recommends
#Installing Optional cli enhancement PHP Modules
#RUN apt install -y php${PHPVERSION}-pcntl --no-install-recommendsb
#Installing Optional PHP module requried for face recogniton
RUN echo "deb https://repo.delellis.com.ar bullseye bullseye" > /etc/apt/sources.list.d/20-pdlib.list \
&& wget -qO - https://repo.delellis.com.ar/repo.gpg.key | apt-key add - \
&& apt update \
&& apt install -y php${PHPVERSION}-pdlib --no-install-recommends \
&& apt auto-remove -y \
&& apt clean -y
#RUN apt install php${PHPVERSION}-dev libx11-dev libopenblas-dev liblapack-dev make cmake gcc g++ -y \
# && git clone https://github.com/davisking/dlib.git \
# && cd dlib/dlib && mkdir build && cd build \
# && cmake -DBUILD_SHARED_LIBS=ON .. \
# && make && make install \
# && cd \
# && git clone https://github.com/goodspb/pdlib.git \
# && cd pdlib \
# && phpize && ./configure --enable-debug \
# && make && make install \
# && apt auto-remove -y \
# && apt clean -y \
# && rm -vr pdlib dlib
# Delete default stuff
RUN rm -rv /var/www/html/index.nginx-debian.html \
/etc/php/ \
/etc/nginx/ \
/root/nextcloud/config/
# enable cron.php to run
RUN usermod --shell '/bin/bash' www-data \
&& echo -e "bruh\nbruh" | passwd www-data
#Autoconfig defaults
RUN mkdir -pv default_configs/etc/ default_configs/var/
COPY buildfiles/etc/ default_configs/etc/
COPY buildfiles/var/ default_configs/var/
#autostart files
COPY buildfiles/auto_config.sh .
COPY buildfiles/start_services.sh .
RUN chmod +x auto_config.sh
RUN chmod +x start_services.sh
CMD ["./start_services.sh"]