nextcloud/Dockerfile
2022-10-07 19:49:52 +05:00

83 lines
2.5 KiB
Docker

FROM debian:11-slim
WORKDIR /root
ARG NEXTCLOUD_VESION=1
ARG PHPVERSION=8.1
#Initial update packges
RUN apt update && apt upgrade
# 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 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
# 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} -y --no-install-recommends \
&& mkdir /run/php/
#Installing Required PHP Modules
RUN bash -c 'apt install -y php${PHPVERSION}-{fpm,cli,bcmath,bz2,intl,common,ctype,curl,dom,gd,mbstring,posix,simplexml,xmlreader,xmlwriter,zip} --no-install-recommends'
#Installing database connector PHP Modules
RUN bash -c 'apt install -y php${PHPVERSION}-mysql --no-install-recommends'
#Installing recommended PHP Modules
RUN bash -c 'apt install -y php${PHPVERSION}-{fileinfo,bz2,intl} --no-install-recommends'
#Installing Optional Specific app PHP Modules
RUN bash -c 'apt install -y php${PHPVERSION}-{gmp,exif} --no-install-recommends'
#Installing Optional server performance enhancement PHP Modules
RUN bash -c '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 bash -c 'apt install -y php${PHPVERSION}-imagick imagemagick ffmpeg libreoffice --no-install-recommends'
#Installing Optional cli enhancement PHP Modules
#RUN bash -c 'apt install -y php${PHPVERSION}-pcntl --no-install-recommends'
# Delete default stuff
#nginx
RUN rm -rv /var/www/html/index.nginx-debian.html \
/etc/php/ \
/etc/nginx/
#Autoconfig defaults
RUN mkdir -pv default_configs/etc/
COPY buildfiles/etc/ default_configs/etc/
#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"]