Update roundcubemail/Dockerfile, roundcubemail/apache2-foreground files

This commit is contained in:
Adrien le Maire 2021-02-10 15:30:58 +00:00
parent 783f804556
commit 2f0862d098
2 changed files with 44 additions and 3 deletions

View File

@ -42,7 +42,7 @@ RUN curl -fL https://raw.githubusercontent.com/vishnubob/wait-for-it/master/wait
COPY php.ini /usr/local/etc/php/conf.d/roundcube-defaults.ini COPY php.ini /usr/local/etc/php/conf.d/roundcube-defaults.ini
COPY docker-entrypoint.sh / COPY docker-entrypoint.sh /
COPY apache2-foreground /usr/local/bin/
ENTRYPOINT ["/docker-entrypoint.sh"] ENTRYPOINT ["/docker-entrypoint.sh"]
CMD ["apache2-foreground"] CMD ["apache2-foreground"]
@ -51,14 +51,15 @@ VOLUME /var/roundcube/config
VOLUME /var/roundcube/db VOLUME /var/roundcube/db
VOLUME /var/www/html VOLUME /var/www/html
VOLUME /tmp/roundcube-temp VOLUME /tmp/roundcube-temp
WORKDIR /var/www/html
STOPSIGNAL SIGWINCH
# Define Roundcubemail version # Define Roundcubemail version
ARG VERSION ARG VERSION
ENV ROUNDCUBEMAIL_VERSION $VERSION ENV ROUNDCUBEMAIL_VERSION $VERSION
# Download package and extract to web volume # Download package and extract to web volume
RUN set -ex; \ RUN set -ex; \
chmod +x /docker-entrypoint.sh; \ chmod +x /docker-entrypoint.sh /usr/local/bin/apache2-foreground; \
curl -o roundcubemail.tar.gz -fSL https://github.com/roundcube/roundcubemail/releases/download/${ROUNDCUBEMAIL_VERSION}/roundcubemail-${ROUNDCUBEMAIL_VERSION}-complete.tar.gz; \ curl -o roundcubemail.tar.gz -fSL https://github.com/roundcube/roundcubemail/releases/download/${ROUNDCUBEMAIL_VERSION}/roundcubemail-${ROUNDCUBEMAIL_VERSION}-complete.tar.gz; \
curl -o roundcubemail.tar.gz.asc -fSL https://github.com/roundcube/roundcubemail/releases/download/${ROUNDCUBEMAIL_VERSION}/roundcubemail-${ROUNDCUBEMAIL_VERSION}-complete.tar.gz.asc; \ curl -o roundcubemail.tar.gz.asc -fSL https://github.com/roundcube/roundcubemail/releases/download/${ROUNDCUBEMAIL_VERSION}/roundcubemail-${ROUNDCUBEMAIL_VERSION}-complete.tar.gz.asc; \
export GNUPGHOME="$(mktemp -d)"; \ export GNUPGHOME="$(mktemp -d)"; \

View File

@ -0,0 +1,40 @@
#!/bin/bash
set -e
# Note: we don't just use "apache2ctl" here because it itself is just a shell-script wrapper around apache2 which provides extra functionality like "apache2ctl start" for launching apache2 in the background.
# (also, when run as "apache2ctl <apache args>", it does not use "exec", which leaves an undesirable resident shell process)
: "${APACHE_CONFDIR:=/etc/apache2}"
: "${APACHE_ENVVARS:=$APACHE_CONFDIR/envvars}"
if test -f "$APACHE_ENVVARS"; then
. "$APACHE_ENVVARS"
fi
# Apache gets grumpy about PID files pre-existing
: "${APACHE_RUN_DIR:=/var/run/apache2}"
: "${APACHE_PID_FILE:=$APACHE_RUN_DIR/apache2.pid}"
rm -f "$APACHE_PID_FILE"
# create missing directories
# (especially APACHE_RUN_DIR, APACHE_LOCK_DIR, and APACHE_LOG_DIR)
for e in "${!APACHE_@}"; do
if [[ "$e" == *_DIR ]] && [[ "${!e}" == /* ]]; then
# handle "/var/lock" being a symlink to "/run/lock", but "/run/lock" not existing beforehand, so "/var/lock/something" fails to mkdir
# mkdir: cannot create directory '/var/lock': File exists
dir="${!e}"
while [ "$dir" != "$(dirname "$dir")" ]; do
dir="$(dirname "$dir")"
if [ -d "$dir" ]; then
break
fi
absDir="$(readlink -f "$dir" 2>/dev/null || :)"
if [ -n "$absDir" ]; then
mkdir -p "$absDir"
fi
done
mkdir -p "${!e}"
fi
done
exec apache2 -DFOREGROUND "$@"