Chris
d222a2189f
adds postgres headers and the php modules for pdo_pgsql so you can run nextcloud with a postgres database backend
105 lines
2.8 KiB
Docker
105 lines
2.8 KiB
Docker
FROM php:8.2-apache
|
|
|
|
ENV NEXTCLOUD_VERSION 26.0.4
|
|
|
|
RUN \
|
|
apt-get update && \
|
|
apt-get install -y eatmydata && \
|
|
eatmydata apt-get install -y --no-install-recommends \
|
|
supervisor \
|
|
cron \
|
|
sudo \
|
|
ffmpeg \
|
|
libldap2-dev \
|
|
libxml2-dev \
|
|
libpng-dev \
|
|
libcurl4-openssl-dev \
|
|
libmagickwand-dev \
|
|
libbz2-dev \
|
|
icu-devtools \
|
|
libicu-dev \
|
|
libzip-dev \
|
|
libmcrypt-dev \
|
|
libfreetype6-dev \
|
|
libssl-dev \
|
|
libjpeg-dev \
|
|
libgmp-dev \
|
|
curl \
|
|
libpq-dev \
|
|
cron && \
|
|
apt-get clean && \
|
|
rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
|
|
|
|
#Dirty hack to circumvent bug in phpize which is open since May 2016
|
|
#Basically the "missing" config.m4 is named "config0.m4"
|
|
#This tries to install zlib and if it doesn't work then rename the file and try again"
|
|
RUN \
|
|
docker-php-ext-install zlib || \
|
|
( mv /usr/src/php/ext/zlib/config0.m4 /usr/src/php/ext/zlib/config.m4 && \
|
|
docker-php-ext-install zlib )
|
|
|
|
# See above
|
|
RUN \
|
|
docker-php-ext-install openssl || \
|
|
( mv /usr/src/php/ext/openssl/config0.m4 /usr/src/php/ext/openssl/config.m4 && \
|
|
docker-php-ext-install openssl )
|
|
|
|
RUN \
|
|
docker-php-ext-configure ldap --with-libdir=lib/x86_64-linux-gnu && \
|
|
docker-php-ext-configure gd --with-freetype=/usr/include/ --with-jpeg=/usr/include/ && \
|
|
docker-php-ext-install \
|
|
ldap \
|
|
ctype \
|
|
dom \
|
|
gd \
|
|
gmp \
|
|
xmlwriter \
|
|
zip \
|
|
pdo_mysql \
|
|
curl \
|
|
bz2 \
|
|
intl \
|
|
bcmath \
|
|
sysvsem \
|
|
pcntl \
|
|
opcache \
|
|
pdo_pgsql \
|
|
pdo && \
|
|
CFLAGS="-I/usr/src/php" docker-php-ext-install xmlreader
|
|
|
|
RUN \
|
|
pecl install -o -f apcu && \
|
|
rm -rf /tmp/pear && \
|
|
docker-php-ext-enable apcu
|
|
|
|
# compile imagick from master branch as there isn't any release for php8 yet.
|
|
RUN \
|
|
pecl install imagick && \
|
|
docker-php-ext-enable imagick
|
|
|
|
# Activate user-defined .htaccess
|
|
RUN \
|
|
a2enmod rewrite env
|
|
|
|
# Add extra configuration to php.ini
|
|
ADD nextcloud_php.ini /usr/local/etc/php/conf.d/nextcloud_php.ini
|
|
|
|
RUN \
|
|
curl -o /tmp/nextcloud.tar.bz2 https://download.nextcloud.com/server/releases/nextcloud-${NEXTCLOUD_VERSION}.tar.bz2 && \
|
|
tar xvjf /tmp/nextcloud.tar.bz2 -C /tmp && \
|
|
rm -rf /var/www/html && \
|
|
mv /tmp/nextcloud /var/www/html && \
|
|
chown -R www-data:www-data /var/www/html && \
|
|
rm /tmp/nextcloud.tar.bz2
|
|
|
|
# Add supervisor and cron config
|
|
ADD crontab /opt/crontab
|
|
ADD supervisord.conf /etc/supervisor/conf.d/supervisord.conf
|
|
ADD update-htaccess.sh /update-htaccess.sh
|
|
|
|
RUN crontab /opt/crontab && chmod +x /update-htaccess.sh
|
|
RUN mkdir /nc_data_ext && chown www-data: /nc_data_ext
|
|
|
|
VOLUME ["/var/www/html/config","/nc_data_ext"]
|
|
|
|
ENTRYPOINT ["supervisord"]
|