11# DO NOT EDIT: created by update.sh from Dockerfile-debian.template
2- FROM php:8.0 -apache-bullseye
2+ FROM php:8.4 -apache-trixie
33
44# entrypoint.sh and cron.sh dependencies
55RUN set -ex; \
@@ -9,9 +9,12 @@ RUN set -ex; \
99 rsync \
1010 bzip2 \
1111 busybox-static \
12+ ghostscript \
13+ imagemagick \
1214 libldap-common \
15+ libmagickcore-7.q16-10-extra \
1316 ; \
14- rm -rf /var/lib/apt/lists/* ; \
17+ apt-get dist-clean ; \
1518 \
1619 mkdir -p /var/spool/cron/crontabs; \
1720 echo '*/5 * * * * php -f /var/www/html/cron.php' > /var/spool/cron/crontabs/www-data
@@ -24,6 +27,8 @@ RUN chmod +x /usr/local/bin/install-php-extensions && sync
2427
2528ENV PHP_MEMORY_LIMIT 512M
2629ENV PHP_UPLOAD_LIMIT 512M
30+ ENV PHP_OPCACHE_MEMORY_CONSUMPTION 128
31+ ENV IPE_GD_WITHOUTAVIF 1
2732RUN set -ex; \
2833 \
2934 install-php-extensions \
@@ -32,6 +37,7 @@ RUN set -ex; \
3237 exif \
3338 gd \
3439 gmp \
40+ igbinary \
3541 imagick \
3642 intl \
3743 ldap \
@@ -41,41 +47,88 @@ RUN set -ex; \
4147 pdo_mysql \
4248 pdo_pgsql \
4349 redis \
50+ sysvsem \
4451 zip \
4552 ;
4653
54+ # trust all ldap certificates
55+ RUN { \
56+ echo 'TLS_REQCERT allow' ; \
57+ } >> /etc/ldap/ldap.conf
58+
4759# set recommended PHP.ini settings
4860# see https://docs.nextcloud.com/server/stable/admin_manual/configuration_server/server_tuning.html#enable-php-opcache
4961RUN { \
50- echo 'opcache.interned_strings_buffer=16' ; \
51- echo 'opcache.revalidate_freq=5' ; \
52- echo 'opcache.jit_buffer_size=100M' ; \
53- } > /usr/local/etc/php/conf.d/opcache-recommended.ini; \
62+ echo 'opcache.enable=1' ; \
63+ echo 'opcache.interned_strings_buffer=32' ; \
64+ echo 'opcache.jit=1255' ; \
65+ echo 'opcache.jit_buffer_size=128M' ; \
66+ echo 'opcache.max_accelerated_files=10000' ; \
67+ echo 'opcache.memory_consumption=${PHP_OPCACHE_MEMORY_CONSUMPTION}' ; \
68+ echo 'opcache.revalidate_freq=60' ; \
69+ echo 'opcache.save_comments=1' ; \
70+ } > "${PHP_INI_DIR}/conf.d/opcache-recommended.ini" ; \
5471 \
55- echo 'apc.enable_cli=1' >> /usr/local/etc/php/conf.d/docker-php-ext-apcu.ini; \
72+ { \
73+ echo 'apc.enable_cli=1' ; \
74+ echo 'apc.shm_size=128M' ; \
75+ } >> "${PHP_INI_DIR}/conf.d/docker-php-ext-apcu.ini" ; \
5676 \
5777 { \
78+ echo 'always_populate_raw_post_data=-1' ; \
79+ echo 'default_socket_timeout=600' ; \
80+ echo 'max_execution_time=300' ; \
81+ echo 'max_input_time=300' ; \
5882 echo 'memory_limit=${PHP_MEMORY_LIMIT}' ; \
59- echo 'upload_max_filesize=${PHP_UPLOAD_LIMIT} ' ; \
83+ echo 'output_buffering=0 ' ; \
6084 echo 'post_max_size=${PHP_UPLOAD_LIMIT}' ; \
61- } > /usr/local/etc/php/conf.d/nextcloud.ini; \
85+ echo 'upload_max_filesize=${PHP_UPLOAD_LIMIT}' ; \
86+ } > "${PHP_INI_DIR}/conf.d/nextcloud.ini" ; \
87+ \
88+ { \
89+ echo 'apc.serializer=igbinary' ; \
90+ echo 'session.serialize_handler=igbinary' ; \
91+ } >> "${PHP_INI_DIR}/conf.d/docker-php-ext-igbinary.ini" ; \
92+ \
93+ { \
94+ echo 'redis.session.locking_enabled = 1' ; \
95+ echo 'redis.session.lock_retries = -1' ; \
96+ echo 'redis.session.lock_wait_time = 10000' ; \
97+ echo 'session.gc_maxlifetime = 86400' ; \
98+ } > "${PHP_INI_DIR}/conf.d/redis-session.ini" ; \
6299 \
63100 mkdir /var/www/data; \
101+ mkdir -p /docker-entrypoint-hooks.d/pre-installation \
102+ /docker-entrypoint-hooks.d/post-installation \
103+ /docker-entrypoint-hooks.d/pre-upgrade \
104+ /docker-entrypoint-hooks.d/post-upgrade \
105+ /docker-entrypoint-hooks.d/before-starting; \
64106 chown -R www-data:root /var/www; \
65107 chmod -R g=u /var/www
66108
109+ # set ImageMagick policy
110+ RUN sed -i'' 's|.*<policy domain="coder".*"PDF".*| <policy domain="coder" rights="read \| write" pattern="PDF" />|g' \
111+ /etc/ImageMagick-7/policy.xml
112+
67113VOLUME /var/www/html
68114
69- RUN a2enmod headers rewrite remoteip ;\
70- {\
71- echo RemoteIPHeader X-Real-IP ; \
72- echo RemoteIPTrustedProxy 10.0.0.0/8 ; \
73- echo RemoteIPTrustedProxy 172.16.0.0/12 ; \
74- echo RemoteIPTrustedProxy 192.168.0.0/16 ; \
75- } > /etc/apache2/conf-available/remoteip.conf;\
115+ RUN a2enmod headers rewrite remoteip ; \
116+ { \
117+ echo ' RemoteIPHeader X-Real-IP' ; \
118+ echo 'RemoteIPInternalProxy 10.0.0.0/8' ; \
119+ echo 'RemoteIPInternalProxy 172.16.0.0/12' ; \
120+ echo 'RemoteIPInternalProxy 192.168.0.0/16' ; \
121+ } > /etc/apache2/conf-available/remoteip.conf; \
76122 a2enconf remoteip
77123
78- ENV NEXTCLOUD_VERSION 23.0.3
124+ # set apache config LimitRequestBody
125+ ENV APACHE_BODY_LIMIT 1073741824
126+ RUN { \
127+ echo 'LimitRequestBody ${APACHE_BODY_LIMIT}' ; \
128+ } > /etc/apache2/conf-available/apache-limits.conf; \
129+ a2enconf apache-limits
130+
131+ ENV NEXTCLOUD_VERSION 32.0.1
79132
80133RUN set -ex; \
81134 fetchDeps=" \
@@ -112,8 +165,7 @@ CMD ["apache2-foreground"]
112165
113166RUN apt-get update && apt-get install -y \
114167 supervisor \
115- && rm -rf /var/lib/apt/lists/* \
116- && mkdir /var/log/supervisord /var/run/supervisord
168+ && rm -rf /var/lib/apt/lists/*
117169
118170COPY supervisord.conf /
119171
0 commit comments