forked from jeboehm/docker-mailserver
-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Improve image size / Update mailserver-admin and php
feat: Improved web image size (fixes jeboehm#98) feat: Update to mailserver-admin 2.0.3 / PHP 8 (jeboehm#156)
- Loading branch information
Showing
5 changed files
with
57 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,9 @@ | ||
FROM jwilder/dockerize:0.6.1 AS dockerize | ||
FROM roundcube/roundcubemail:1.5.x-fpm AS roundcube | ||
FROM jeboehm/php-nginx-base:7.4 | ||
FROM composer:2.3 AS composer | ||
FROM php:8.0-fpm-alpine | ||
|
||
ARG ADMIN_VER=1.6.4 | ||
ARG ADMIN_VER=2.0.3 | ||
|
||
LABEL maintainer="[email protected]" | ||
LABEL vendor="https://github.com/jeboehm/docker-mailserver" | ||
|
@@ -20,21 +21,37 @@ ENV MYSQL_HOST=db \ | |
APP_ENV=prod \ | ||
TRUSTED_PROXIES=172.16.0.0/12 \ | ||
WAITSTART_TIMEOUT=1m \ | ||
ADMIN_VER=${ADMIN_VER} | ||
ADMIN_VER=${ADMIN_VER} \ | ||
DATABASE_URL="mysql://%env(MYSQL_USER)%:%env(MYSQL_PASSWORD)%@%env(MYSQL_HOST)%:3306/%env(MYSQL_DATABASE)%?serverVersion=mariadb-10.4.11" | ||
|
||
COPY --from=roundcube /usr/src/roundcubemail/ /var/www/html/webmail/ | ||
COPY --from=dockerize /usr/local/bin/dockerize /usr/local/bin | ||
COPY --from=composer /usr/bin/composer /usr/bin/composer | ||
|
||
RUN apk add --no-cache \ | ||
icu \ | ||
icu-dev \ | ||
nginx \ | ||
supervisor && \ | ||
docker-php-ext-install -j5 \ | ||
intl \ | ||
opcache \ | ||
pdo_mysql && \ | ||
ln -sf /dev/stdout /var/log/nginx/access.log && \ | ||
ln -sf /dev/stderr /var/log/nginx/error.log && \ | ||
apk del --no-cache icu-dev | ||
|
||
COPY rootfs/ / | ||
|
||
WORKDIR /opt/manager | ||
|
||
RUN wget -O /tmp/admin.tar.gz -q https://github.com/jeboehm/mailserver-admin/archive/${ADMIN_VER}.tar.gz && \ | ||
tar -xf /tmp/admin.tar.gz -C /opt/manager --strip=1 && \ | ||
rm /tmp/admin.tar.gz && \ | ||
composer install --no-dev -o && \ | ||
rm -f /etc/nginx/conf.d/realip.conf | ||
|
||
RUN ln -s /opt/manager/public /var/www/html/manager && \ | ||
composer install --no-dev --prefer-dist -o --apcu-autoloader && \ | ||
bin/console cache:clear --no-warmup --env=prod && \ | ||
bin/console cache:warmup --env=prod && \ | ||
ln -s /opt/manager/public /var/www/html/manager && \ | ||
chown -R www-data \ | ||
/opt/manager/var/cache/ \ | ||
/opt/manager/var/log/ \ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
[supervisord] | ||
nodaemon=true | ||
logfile=/dev/stderr | ||
logfile_maxbytes=0 | ||
pidfile=/run/supervisord.pid | ||
user=root | ||
|
||
[program:php-fpm] | ||
command=/usr/local/sbin/php-fpm | ||
redirect_stderr=true | ||
stdout_logfile=/dev/stderr | ||
stdout_logfile_maxbytes=0 | ||
|
||
[program:nginx] | ||
command=/usr/sbin/nginx -g "daemon off; pid off;" | ||
redirect_stderr=true | ||
stdout_logfile=/dev/stderr | ||
stdout_logfile_maxbytes=0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
opcache.memory_consumption = 256 | ||
opcache.max_accelerated_files = 20000 | ||
opcache.validate_timestamps = 0 | ||
|
||
realpath_cache_size = 4096K | ||
realpath_cache_ttl = 600 | ||
|
||
expose_php = Off | ||
display_errors = Off |