2019-06-23 02:24:02 +02:00
|
|
|
FROM php:%%PHP_VERSION%%-%%VARIANT%%-stretch
|
2018-05-18 21:20:22 +02:00
|
|
|
|
|
|
|
# entrypoint.sh and cron.sh dependencies
|
|
|
|
RUN set -ex; \
|
|
|
|
\
|
|
|
|
apt-get update; \
|
|
|
|
apt-get install -y --no-install-recommends \
|
|
|
|
rsync \
|
|
|
|
bzip2 \
|
|
|
|
git \
|
2018-10-05 21:20:25 +02:00
|
|
|
# For mail() support
|
2018-10-05 20:05:27 +02:00
|
|
|
ssmtp \
|
2020-03-08 20:47:56 +01:00
|
|
|
# For tini installation
|
|
|
|
gnupg dirmngr \
|
2018-05-18 21:20:22 +02:00
|
|
|
; \
|
2018-05-21 21:32:26 +02:00
|
|
|
rm -rf /var/lib/apt/lists/*;
|
2018-05-18 21:20:22 +02:00
|
|
|
|
2020-03-08 20:47:56 +01:00
|
|
|
# Add tini for reaping processes
|
|
|
|
ENV TINI_VERSION v%%TINI_VERSION%%
|
2020-03-09 21:39:50 +01:00
|
|
|
RUN export BUILD_ARCH=$(dpkg-architecture --query DEB_BUILD_ARCH) \
|
|
|
|
&& curl -L -o /sbin/tini https://github.com/krallin/tini/releases/download/${TINI_VERSION}/tini-${BUILD_ARCH} \
|
|
|
|
&& curl -L -o /tini.asc https://github.com/krallin/tini/releases/download/${TINI_VERSION}/tini-${BUILD_ARCH}.asc \
|
|
|
|
&& gpg --batch --keyserver hkp://p80.pool.sks-keyservers.net:80 --recv-keys 595E85A6B1B4779EA4DAAEC70B588DFF0527A9B7 \
|
2020-03-08 20:47:56 +01:00
|
|
|
&& gpg --batch --verify /tini.asc /sbin/tini \
|
|
|
|
&& chmod +x /sbin/tini
|
|
|
|
|
2018-05-18 21:20:22 +02:00
|
|
|
# install the PHP extensions we need
|
|
|
|
# see https://friendi.ca/resources/requirements/
|
|
|
|
RUN set -ex; \
|
|
|
|
\
|
|
|
|
savedAptMark="$(apt-mark showmanual)"; \
|
|
|
|
\
|
|
|
|
apt-get update; \
|
|
|
|
apt-get install -y --no-install-recommends \
|
|
|
|
mysql-client \
|
|
|
|
bash \
|
2018-05-24 21:20:25 +02:00
|
|
|
libpng-dev \
|
2018-05-18 21:20:22 +02:00
|
|
|
libjpeg62-turbo-dev \
|
|
|
|
libtool \
|
|
|
|
libmagick++-dev \
|
2018-06-22 21:12:06 +02:00
|
|
|
libmemcached-dev \
|
2018-05-18 21:20:22 +02:00
|
|
|
libgraphicsmagick1-dev \
|
|
|
|
libfreetype6-dev \
|
|
|
|
librsvg2-2 \
|
2019-06-23 02:24:02 +02:00
|
|
|
libzip-dev \
|
2019-11-16 12:05:28 +01:00
|
|
|
libldap2-dev \
|
2018-05-18 21:20:22 +02:00
|
|
|
; \
|
2019-11-16 12:28:49 +01:00
|
|
|
\
|
|
|
|
debMultiarch="$(dpkg-architecture --query DEB_BUILD_MULTIARCH)"; \
|
|
|
|
\
|
2018-05-18 21:20:22 +02:00
|
|
|
docker-php-ext-configure gd \
|
|
|
|
--with-gd \
|
|
|
|
--with-freetype-dir=/usr/include/ \
|
|
|
|
--with-png-dir=/usr/include/ \
|
|
|
|
--with-jpeg-dir=/usr/include/ \
|
|
|
|
; \
|
2019-11-16 12:05:28 +01:00
|
|
|
docker-php-ext-configure ldap \
|
2020-06-15 00:30:25 +02:00
|
|
|
--with-libdir=lib/$debMultiarch/ \
|
|
|
|
;\
|
2019-07-19 17:37:44 +02:00
|
|
|
docker-php-ext-install -j "$(nproc)" \
|
2019-06-23 02:24:02 +02:00
|
|
|
pdo_mysql \
|
|
|
|
gd \
|
|
|
|
zip \
|
|
|
|
opcache \
|
|
|
|
ctype \
|
2019-08-04 20:04:42 +02:00
|
|
|
pcntl \
|
2019-11-16 12:05:28 +01:00
|
|
|
ldap \
|
2018-05-18 21:20:22 +02:00
|
|
|
; \
|
2019-06-23 02:24:02 +02:00
|
|
|
\
|
2018-06-22 21:12:06 +02:00
|
|
|
# pecl will claim success even if one install fails, so we need to perform each install separately
|
2019-06-23 02:24:02 +02:00
|
|
|
pecl install apcu-%%APCU_VERSION%%; \
|
2018-06-22 21:12:06 +02:00
|
|
|
pecl install memcached-%%MEMCACHED_VERSION%%; \
|
|
|
|
pecl install redis-%%REDIS_VERSION%%; \
|
2019-06-23 02:24:02 +02:00
|
|
|
pecl install imagick-%%IMAGICK_VERSION%%; \
|
2018-06-22 21:12:06 +02:00
|
|
|
\
|
|
|
|
docker-php-ext-enable \
|
2019-06-23 02:24:02 +02:00
|
|
|
apcu \
|
2018-06-22 21:12:06 +02:00
|
|
|
memcached \
|
|
|
|
redis \
|
2019-06-23 02:24:02 +02:00
|
|
|
imagick \
|
2018-06-22 21:12:06 +02:00
|
|
|
; \
|
|
|
|
\
|
2018-05-18 21:20:22 +02:00
|
|
|
# reset apt-mark's "manual" list so that "purge --auto-remove" will remove all build dependencies
|
|
|
|
apt-mark auto '.*' > /dev/null; \
|
|
|
|
apt-mark manual $savedAptMark; \
|
|
|
|
ldd "$(php -r 'echo ini_get("extension_dir");')"/*.so \
|
2020-06-15 00:30:25 +02:00
|
|
|
| awk '/=>/ { print $3 }' \
|
|
|
|
| sort -u \
|
|
|
|
| xargs -r dpkg-query -S \
|
|
|
|
| cut -d: -f1 \
|
|
|
|
| sort -u \
|
|
|
|
| xargs -rt apt-mark manual; \
|
2018-05-18 21:20:22 +02:00
|
|
|
\
|
|
|
|
apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false; \
|
|
|
|
rm -rf /var/lib/apt/lists/*
|
|
|
|
|
2019-07-19 17:37:44 +02:00
|
|
|
# set recommended PHP.ini settings
|
2019-08-25 22:58:48 +02:00
|
|
|
RUN set -ex; \
|
|
|
|
{ \
|
2019-07-19 17:37:44 +02:00
|
|
|
echo 'opcache.enable=1' ; \
|
|
|
|
echo 'opcache.interned_strings_buffer=8'; \
|
|
|
|
echo 'opcache.max_accelerated_files=10000'; \
|
|
|
|
echo 'opcache.memory_consumption=128'; \
|
|
|
|
echo 'opcache.save_comments=1'; \
|
|
|
|
echo 'opcache.revalidte_freq=1'; \
|
|
|
|
} > /usr/local/etc/php/conf.d/opcache-recommended.ini; \
|
|
|
|
\
|
|
|
|
{ \
|
|
|
|
echo sendmail_path = "/usr/sbin/sendmail -t -i"; \
|
2019-06-23 02:24:02 +02:00
|
|
|
} > /usr/local/etc/php/conf.d/sendmail.ini; \
|
|
|
|
\
|
|
|
|
echo 'apc.enable_cli=1' >> /usr/local/etc/php/conf.d/docker-php-ext-apcu.ini; \
|
|
|
|
\
|
|
|
|
echo 'memory_limit=512M' > /usr/local/etc/php/conf.d/memory-limit.ini; \
|
|
|
|
\
|
|
|
|
mkdir /var/www/data; \
|
|
|
|
chown -R www-data:root /var/www; \
|
2018-05-18 21:20:22 +02:00
|
|
|
chmod -R g=u /var/www
|
|
|
|
|
|
|
|
VOLUME /var/www/html
|
2018-05-24 21:20:25 +02:00
|
|
|
%%VARIANT_EXTRAS%%
|
2018-05-18 21:20:22 +02:00
|
|
|
|
2018-05-24 21:20:25 +02:00
|
|
|
ENV FRIENDICA_VERSION %%VERSION%%
|
2020-06-14 18:41:58 +02:00
|
|
|
ENV FRIENDICA_VERSION_YEAR %%VERSION_YEAR%%
|
|
|
|
ENV FRIENDICA_VERSION_MONTH %%VERSION_MONTH%%
|
2018-05-24 22:38:25 +02:00
|
|
|
ENV FRIENDICA_ADDONS %%VERSION%%
|
2018-06-06 20:37:02 +02:00
|
|
|
%%INSTALL_EXTRAS%%
|
|
|
|
|
2019-07-19 17:37:44 +02:00
|
|
|
COPY *.sh upgrade.exclude /
|
|
|
|
COPY config/* /usr/src/friendica/config/
|
|
|
|
|
2019-11-26 21:47:40 +01:00
|
|
|
ENTRYPOINT ["/%%ENTRYPOINT%%"]
|
2018-05-24 21:20:25 +02:00
|
|
|
CMD ["%%CMD%%"]
|