fpm-alpine

This commit is contained in:
Greg Hendrickson
2023-10-24 15:55:18 -07:00
parent 3944860f7c
commit d8a8d3bbda
2 changed files with 22 additions and 31 deletions

View File

@@ -1,29 +1,25 @@
FROM nextcloud:apache FROM nextcloud:fpm-alpine
RUN set -ex; \ RUN set -ex; \
\ \
apt-get update; \ apk add --no-cache \
apt-get install -y --no-install-recommends \
ffmpeg \ ffmpeg \
ghostscript \ imagemagick \
libmagickcore-6.q16-6-extra \
procps \ procps \
smbclient \ samba-client \
supervisor \ supervisor \
# libreoffice \ # libreoffice \
; \ ;
rm -rf /var/lib/apt/lists/*
RUN set -ex; \ RUN set -ex; \
\ \
savedAptMark="$(apt-mark showmanual)"; \ apk add --no-cache --virtual .build-deps \
\ $PHPIZE_DEPS \
apt-get update; \ imap-dev \
apt-get install -y --no-install-recommends \ krb5-dev \
libbz2-dev \ openssl-dev \
libc-client-dev \ samba-dev \
libkrb5-dev \ bzip2-dev \
libsmbclient-dev \
; \ ; \
\ \
docker-php-ext-configure imap --with-kerberos --with-imap-ssl; \ docker-php-ext-configure imap --with-kerberos --with-imap-ssl; \
@@ -34,19 +30,14 @@ RUN set -ex; \
pecl install smbclient; \ pecl install smbclient; \
docker-php-ext-enable smbclient; \ docker-php-ext-enable smbclient; \
\ \
# reset apt-mark's "manual" list so that "purge --auto-remove" will remove all build dependencies runDeps="$( \
apt-mark auto '.*' > /dev/null; \ scanelf --needed --nobanner --format '%n#p' --recursive /usr/local/lib/php/extensions \
apt-mark manual $savedAptMark; \ | tr ',' '\n' \
ldd "$(php -r 'echo ini_get("extension_dir");')"/*.so \
| awk '/=>/ { so = $(NF-1); if (index(so, "/usr/local/") == 1) { next }; gsub("^/(usr/)?", "", so); print so }' \
| sort -u \ | sort -u \
| xargs -r dpkg-query --search \ | awk 'system("[ -e /usr/local/lib/" $1 " ]") == 0 { next } { print "so:" $1 }' \
| cut -d: -f1 \ )"; \
| sort -u \ apk add --virtual .nextcloud-phpext-rundeps $runDeps; \
| xargs -rt apt-mark manual; \ apk del .build-deps
\
apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false; \
rm -rf /var/lib/apt/lists/*
RUN mkdir -p \ RUN mkdir -p \
/var/log/supervisord \ /var/log/supervisord \

View File

@@ -7,12 +7,12 @@ logfile_maxbytes=50MB ; maximum size of logfile before
logfile_backups=10 ; number of backed up logfiles logfile_backups=10 ; number of backed up logfiles
loglevel=error loglevel=error
[program:apache2] [program:php-fpm]
stdout_logfile=/dev/stdout stdout_logfile=/dev/stdout
stdout_logfile_maxbytes=0 stdout_logfile_maxbytes=0
stderr_logfile=/dev/stderr stderr_logfile=/dev/stderr
stderr_logfile_maxbytes=0 stderr_logfile_maxbytes=0
command=apache2-foreground command=php-fpm
[program:cron] [program:cron]
stdout_logfile=/dev/stdout stdout_logfile=/dev/stdout