apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false; \
rm -rf /var/lib/apt/lists/*
+# installto.sh dependencies
+RUN set -ex; \
+ \
+ apt-get update; \
+ apt-get install -y --no-install-recommends \
+ rsync \
+ ; \
+ rm -rf /var/lib/apt/lists/*
+
+# ... and composer.phar
+ADD https://getcomposer.org/installer /tmp/composer-installer.php
+
+RUN php /tmp/composer-installer.php --install-dir=/usr/local/bin/; \
+ rm /tmp/composer-installer.php
+
# enable mod_rewrite
RUN a2enmod rewrite
# PWD=`pwd`
if [[ "$1" == apache2* ]] || [ "$1" == php-fpm ]; then
+ # docroot is empty
if ! [ -e index.php -a -e bin/installto.sh ]; then
echo >&2 "roundcubemail not found in $PWD - copying now..."
if [ "$(ls -A)" ]; then
fi
tar cf - --one-file-system -C /usr/src/roundcubemail . | tar xf -
echo >&2 "Complete! ROUNDCUBEMAIL has been successfully copied to $PWD"
+ # update Roundcube in docroot
+ else
+ INSTALLDIR=`pwd`
+ echo >&2 "roundcubemail found in $INSTALLDIR - installing update..."
+ (cd /usr/src/roundcubemail && bin/installto.sh -y $INSTALLDIR)
+ composer.phar update --no-dev
fi
if [ -f /run/secrets/roundcube_db_user ]; then
echo "include('$fn');" >> config/config.inc.php
done
- # initialize DB if not SQLite
- echo "${ROUNDCUBEMAIL_DSNW}" | grep -q 'sqlite:' || bin/initdb.sh --dir=$PWD/SQL || bin/updatedb.sh --dir=$PWD/SQL --package=roundcube || echo "Failed to initialize databse. Please run $PWD/bin/initdb.sh manually."
+ # initialize or update DB
+ bin/initdb.sh --dir=$PWD/SQL --create || bin/updatedb.sh --dir=$PWD/SQL --package=roundcube || echo "Failed to initialize database. Please run $PWD/bin/initdb.sh and $PWD/bin/updatedb.sh manually."
else
echo "WARNING: $PWD/config/config.inc.php already exists."
echo "ROUNDCUBEMAIL_* environment variables have been ignored."
FROM php:7.3-fpm-alpine
LABEL maintainer="Thomas Bruederli <thomas@roundcube.net>"
-# entrypoint.sh and cron.sh dependencies
+# entrypoint.sh and installto.sh dependencies
RUN set -ex; \
\
apk add --no-cache \
bash \
coreutils \
+ rsync \
tzdata
RUN set -ex; \
apk add --virtual .roundcubemail-phpext-rundeps $runDeps; \
apk del .build-deps
+# add composer.phar
+ADD https://getcomposer.org/installer /tmp/composer-installer.php
+
+RUN php /tmp/composer-installer.php --install-dir=/usr/local/bin/; \
+ rm /tmp/composer-installer.php
+
# expose these volumes
VOLUME /var/roundcube/config
VOLUME /var/roundcube/db
# PWD=`pwd`
if [[ "$1" == apache2* ]] || [ "$1" == php-fpm ]; then
+ # docroot is empty
if ! [ -e index.php -a -e bin/installto.sh ]; then
echo >&2 "roundcubemail not found in $PWD - copying now..."
if [ "$(ls -A)" ]; then
fi
tar cf - --one-file-system -C /usr/src/roundcubemail . | tar xf -
echo >&2 "Complete! ROUNDCUBEMAIL has been successfully copied to $PWD"
+ # update Roundcube in docroot
+ else
+ INSTALLDIR=`pwd`
+ echo >&2 "roundcubemail found in $INSTALLDIR - installing update..."
+ (cd /usr/src/roundcubemail && bin/installto.sh -y $INSTALLDIR)
+ composer.phar update --no-dev
fi
if [ -f /run/secrets/roundcube_db_user ]; then
echo "include('$fn');" >> config/config.inc.php
done
- # initialize DB if not SQLite
- echo "${ROUNDCUBEMAIL_DSNW}" | grep -q 'sqlite:' || bin/initdb.sh --dir=$PWD/SQL || bin/updatedb.sh --dir=$PWD/SQL --package=roundcube || echo "Failed to initialize databse. Please run $PWD/bin/initdb.sh manually."
+ # initialize or update DB
+ bin/initdb.sh --dir=$PWD/SQL --create || bin/updatedb.sh --dir=$PWD/SQL --package=roundcube || echo "Failed to initialize database. Please run $PWD/bin/initdb.sh and $PWD/bin/updatedb.sh manually."
else
echo "WARNING: $PWD/config/config.inc.php already exists."
echo "ROUNDCUBEMAIL_* environment variables have been ignored."
apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false; \
rm -rf /var/lib/apt/lists/*
+# installto.sh dependencies
+RUN set -ex; \
+ \
+ apt-get update; \
+ apt-get install -y --no-install-recommends \
+ rsync \
+ ; \
+ rm -rf /var/lib/apt/lists/*
+
+# ... and composer.phar
+ADD https://getcomposer.org/installer /tmp/composer-installer.php
+
+RUN php /tmp/composer-installer.php --install-dir=/usr/local/bin/; \
+ rm /tmp/composer-installer.php
# expose these volumes
VOLUME /var/roundcube/config
# PWD=`pwd`
if [[ "$1" == apache2* ]] || [ "$1" == php-fpm ]; then
+ # docroot is empty
if ! [ -e index.php -a -e bin/installto.sh ]; then
echo >&2 "roundcubemail not found in $PWD - copying now..."
if [ "$(ls -A)" ]; then
fi
tar cf - --one-file-system -C /usr/src/roundcubemail . | tar xf -
echo >&2 "Complete! ROUNDCUBEMAIL has been successfully copied to $PWD"
+ # update Roundcube in docroot
+ else
+ INSTALLDIR=`pwd`
+ echo >&2 "roundcubemail found in $INSTALLDIR - installing update..."
+ (cd /usr/src/roundcubemail && bin/installto.sh -y $INSTALLDIR)
+ composer.phar update --no-dev
fi
if [ -f /run/secrets/roundcube_db_user ]; then
echo "include('$fn');" >> config/config.inc.php
done
- # initialize DB if not SQLite
- echo "${ROUNDCUBEMAIL_DSNW}" | grep -q 'sqlite:' || bin/initdb.sh --dir=$PWD/SQL || bin/updatedb.sh --dir=$PWD/SQL --package=roundcube || echo "Failed to initialize databse. Please run $PWD/bin/initdb.sh manually."
+ # initialize or update DB
+ bin/initdb.sh --dir=$PWD/SQL --create || bin/updatedb.sh --dir=$PWD/SQL --package=roundcube || echo "Failed to initialize database. Please run $PWD/bin/initdb.sh and $PWD/bin/updatedb.sh manually."
else
echo "WARNING: $PWD/config/config.inc.php already exists."
echo "ROUNDCUBEMAIL_* environment variables have been ignored."