Update php8 to php81. Update snappymail to 2.19.4

main
Dimitri Huisman 2 years ago
parent 59c5b152b2
commit 0e5443a867
No known key found for this signature in database

@ -9,12 +9,13 @@ LABEL version=$VERSION
RUN set -euxo pipefail \ RUN set -euxo pipefail \
; apk add --no-cache \ ; apk add --no-cache \
nginx gpg gpg-agent \ nginx gpg gpg-agent \
php8 php8-fpm php8-mbstring php8-zip php8-xml php8-simplexml \ php81 php81-fpm php81-mbstring php81-zip php81-xml php81-simplexml \
php8-dom php8-curl php8-exif gd php8-gd php8-iconv php8-intl php8-openssl \ php81-dom php81-curl php81-exif gd php81-gd php81-iconv php81-intl php81-openssl \
php8-pdo_sqlite php8-pdo_mysql php8-pdo_pgsql php8-pdo php8-sodium libsodium php8-tidy php8-pecl-uuid \ php81-pdo_sqlite php81-pdo_mysql php81-pdo_pgsql php81-pdo php81-sodium libsodium php81-tidy php81-pecl-uuid \
php8-pspell php8-pecl-imagick php8-opcache php8-session php8-sockets php8-fileinfo \ php81-pspell php81-pecl-imagick php81-opcache php81-session php81-sockets php81-fileinfo \
; rm /etc/nginx/http.d/default.conf \ ; rm /etc/nginx/http.d/default.conf \
; rm /etc/php8/php-fpm.d/www.conf \ ; rm /etc/php81/php-fpm.d/www.conf \
; ln -s /usr/bin/php81 /usr/bin/php \
; mkdir -p /run/nginx \ ; mkdir -p /run/nginx \
; mkdir -p /conf ; mkdir -p /conf
@ -37,14 +38,14 @@ RUN set -euxo pipefail \
# nginx / PHP config files # nginx / PHP config files
COPY config/nginx-roundcube.conf /conf/nginx-roundcube.conf COPY config/nginx-roundcube.conf /conf/
COPY config/php-roundcube.conf /etc/php8/php-fpm.d/roundcube.conf COPY config/php-roundcube.conf /etc/php81/php-fpm.d/roundcube.conf
COPY config/php.ini /conf/php.ini COPY config/php.ini /conf/
COPY config/config.inc.php /conf/config.inc.php COPY config/config.inc.php /conf/
COPY login/mailu.php /var/www/webmail/plugins/mailu/mailu.php COPY login/mailu.php /var/www/webmail/plugins/mailu/
COPY config/config.inc.carddav.php /var/www/webmail/plugins/carddav/config.inc.php COPY config/config.inc.carddav.php /var/www/webmail/plugins/carddav/config.inc.php
COPY start.py /start.py COPY start.py /
EXPOSE 80/tcp EXPOSE 80/tcp
VOLUME /data VOLUME /data

@ -67,7 +67,7 @@ context["INCLUDES"] = sorted(inc for inc in os.listdir("/overrides") if inc.ends
context["SESSION_TIMEOUT_MINUTES"] = max(int(env.get("SESSION_TIMEOUT", "3600")) // 60, 1) context["SESSION_TIMEOUT_MINUTES"] = max(int(env.get("SESSION_TIMEOUT", "3600")) // 60, 1)
# create config files # create config files
conf.jinja("/conf/php.ini", context, "/etc/php8/php.ini") conf.jinja("/conf/php.ini", context, "/etc/php81/php.ini")
conf.jinja("/conf/config.inc.php", context, "/var/www/webmail/config/config.inc.php") conf.jinja("/conf/config.inc.php", context, "/var/www/webmail/config/config.inc.php")
# create dirs # create dirs
@ -111,6 +111,6 @@ if os.path.exists("/var/run/nginx.pid"):
[env.pop(key, None) for key in env.keys() if key == "SECRET_KEY" or key.startswith("ROUNDCUBE_")] [env.pop(key, None) for key in env.keys() if key == "SECRET_KEY" or key.startswith("ROUNDCUBE_")]
# run nginx # run nginx
os.system("php-fpm8") os.system("php-fpm81")
os.execv("/usr/sbin/nginx", ["nginx", "-g", "daemon off;"]) os.execv("/usr/sbin/nginx", ["nginx", "-g", "daemon off;"])

@ -6,57 +6,31 @@ FROM base
ARG VERSION ARG VERSION
LABEL version=$VERSION LABEL version=$VERSION
# https://github.com/the-djmaze/snappymail/wiki/Installation-instructions#requirements
# SnappyMail:
# SnappyMail requires PHP 7.4 (or a newer version) with the following extensions:
#
# mbstring php7-mbstring
# Zlib built-in OR php7-zip????
# json php7-json > php8-json is built-in php8 in alpine
# libxml php7-xml
# dom php7-dom
# Optional extensions:
# cURL php7-curl
# exif php7-exif
# gd, gmagick or imagemagick gd and php7-gd
# gnupg gpgme and alpine has no php7-gnupg library :(
# iconv php7-iconv
# intl php7-intl
# ldap we don't use ldap
# openssl php7-openssl
# PDO (MySQL/PostgreSQL/SQLite) (for contacts) php7-pdo_sqlite and php7-pdo
# redis NOT USED
# Sodium php7-sodium and libsodium
# Tidy php7-tidy
# uuid (PECL) php7-pecl-uuid
# xxtea (PECL) not found on alpine repo
# zip php7-zip
#php7-curl php7-iconv php7-json php7-xml php7-simplexml php7-dom php7-openssl php7-pdo php7-pdo_sqlite php7-mbstring \
RUN set -euxo pipefail \ RUN set -euxo pipefail \
; apk add --no-cache \ ; apk add --no-cache \
nginx curl \ nginx curl \
php8 php8-fpm php8-mbstring php8-zip php8-xml php8-simplexml \ php81 php81-fpm php81-mbstring php81-zip php81-xml php81-simplexml \
php8-dom php8-curl php8-exif gd php8-gd php8-iconv php8-intl php8-openssl \ php81-dom php81-curl php81-exif gd php81-gd php81-iconv php81-intl php81-openssl \
php8-pdo_sqlite php8-pdo php8-sodium libsodium php8-tidy php8-pecl-uuid \ php81-pdo_sqlite php81-pdo php81-sodium libsodium php81-tidy php81-pecl-uuid \
; ln -s /usr/bin/php81 /usr/bin/php \
; rm /etc/nginx/http.d/default.conf \ ; rm /etc/nginx/http.d/default.conf \
; rm /etc/php8/php-fpm.d/www.conf \ ; rm /etc/php81/php-fpm.d/www.conf \
; mkdir -p /run/nginx \ ; mkdir -p /run/nginx \
; mkdir -p /var/www/webmail \ ; mkdir -p /var/www/webmail \
; mkdir -p /config ; mkdir -p /config
# nginx / PHP config files # nginx / PHP config files
COPY config/nginx-snappymail.conf /config/nginx-snappymail.conf COPY config/nginx-snappymail.conf /config/
COPY config/php-snappymail.conf /etc/php8/php-fpm.d/snappymail.conf COPY config/php-snappymail.conf /etc/php81/php-fpm.d/snappymail.conf
# Parsed and moved at startup # Parsed and moved at startup
COPY defaults/php.ini /defaults/php.ini COPY defaults/php.ini /defaults/
COPY defaults/application.ini /defaults/application.ini COPY defaults/application.ini /defaults/
COPY defaults/default.ini /defaults/default.ini COPY defaults/default.ini /defaults/
# Install Snappymail from source # Install Snappymail from source
ENV SNAPPYMAIL_URL https://github.com/the-djmaze/snappymail/releases/download/v2.13.4/snappymail-2.13.4.tar.gz ENV SNAPPYMAIL_URL https://github.com/the-djmaze/snappymail/releases/download/v2.19.4/snappymail-2.19.4.tar.gz
# Note. This is the last working snappymail version. 2.19.6 up to 2.20.6 do not work.
RUN set -euxo pipefail \ RUN set -euxo pipefail \
; cd /var/www/webmail \ ; cd /var/www/webmail \
@ -65,11 +39,11 @@ RUN set -euxo pipefail \
; chown -R nginx:nginx /var/www/webmail ; chown -R nginx:nginx /var/www/webmail
# SnappyMail login # SnappyMail login
COPY login/include.php /var/www/webmail/include.php COPY login/include.php /var/www/webmail/
COPY login/sso.php /var/www/webmail/sso.php COPY login/sso.php /var/www/webmail/
COPY start.py / COPY start.py /
COPY config.py /config.py COPY config.py /
EXPOSE 80/tcp EXPOSE 80/tcp
VOLUME ["/data"] VOLUME ["/data"]

@ -23,9 +23,9 @@ os.makedirs(base + "configs", exist_ok=True)
conf.jinja("/defaults/default.ini", os.environ, "/data/_data_/_default_/domains/default.ini") conf.jinja("/defaults/default.ini", os.environ, "/data/_data_/_default_/domains/default.ini")
conf.jinja("/defaults/application.ini", os.environ, "/data/_data_/_default_/configs/application.ini") conf.jinja("/defaults/application.ini", os.environ, "/data/_data_/_default_/configs/application.ini")
conf.jinja("/defaults/php.ini", os.environ, "/etc/php8/php.ini") conf.jinja("/defaults/php.ini", os.environ, "/etc/php81/php.ini")
# Start the fastcgi process manager now that config files have been adjusted # Start the fastcgi process manager now that config files have been adjusted
os.system("php-fpm8") os.system("php-fpm81")
os.system("chown -R nginx:nginx /data") os.system("chown -R nginx:nginx /data")
os.system("chmod -R a+rX /var/www/webmail/") os.system("chmod -R a+rX /var/www/webmail/")

Loading…
Cancel
Save