From: Lukas Müller Date: Tue, 21 May 2024 20:54:57 +0000 (+0200) Subject: Enable roundcube shell scripts to be directly executed (#238) X-Git-Url: http://git.99rst.org/?a=commitdiff_plain;h=b6c9f5d250f843ef331369d12c7c72c583a1e924;p=roundcube-roundcubemail-docker.git Enable roundcube shell scripts to be directly executed (#238) * Updated conditional in all variants of the docker-entrypoint.sh script to allow for shell scripts to be executed easily * Added example --- diff --git a/apache/docker-entrypoint.sh b/apache/docker-entrypoint.sh index 4ea2ff2..5aaba56 100755 --- a/apache/docker-entrypoint.sh +++ b/apache/docker-entrypoint.sh @@ -3,7 +3,7 @@ # PWD=`pwd` -if [[ "$1" == apache2* ]] || [ "$1" == php-fpm ]; then +if [[ "$1" == apache2* || "$1" == php-fpm || "$1" == bin* ]]; then # docroot is empty if ! [ -e index.php -a -e bin/installto.sh ]; then echo >&2 "roundcubemail not found in $PWD - copying now..." diff --git a/examples/kubernetes.yaml b/examples/kubernetes.yaml index ac73108..557c84b 100644 --- a/examples/kubernetes.yaml +++ b/examples/kubernetes.yaml @@ -145,7 +145,7 @@ spec: - name: roundcubemail image: roundcube/roundcubemail:latest-fpm-alpine imagePullPolicy: "" - env: + env: &env - name: ROUNDCUBEMAIL_DB_TYPE value: pgsql - name: ROUNDCUBEMAIL_DB_HOST @@ -278,3 +278,25 @@ spec: targetPort: 80 selector: service: roundcubenginx +--- +apiVersion: batch/v1 +kind: CronJob +metadata: + name: cleandb +spec: + schedule: "@daily" + concurrencyPolicy: Replace + jobTemplate: + spec: + template: + metadata: + name: cleandb + spec: + restartPolicy: OnFailure + containers: + - name: roundcubemail + image: roundcube/roundcubemail:latest-fpm-alpine + imagePullPolicy: "" + env: *env + args: + - bin/cleandb.sh diff --git a/fpm-alpine/docker-entrypoint.sh b/fpm-alpine/docker-entrypoint.sh index 4ea2ff2..5aaba56 100755 --- a/fpm-alpine/docker-entrypoint.sh +++ b/fpm-alpine/docker-entrypoint.sh @@ -3,7 +3,7 @@ # PWD=`pwd` -if [[ "$1" == apache2* ]] || [ "$1" == php-fpm ]; then +if [[ "$1" == apache2* || "$1" == php-fpm || "$1" == bin* ]]; then # docroot is empty if ! [ -e index.php -a -e bin/installto.sh ]; then echo >&2 "roundcubemail not found in $PWD - copying now..." diff --git a/fpm/docker-entrypoint.sh b/fpm/docker-entrypoint.sh index 4ea2ff2..5aaba56 100755 --- a/fpm/docker-entrypoint.sh +++ b/fpm/docker-entrypoint.sh @@ -3,7 +3,7 @@ # PWD=`pwd` -if [[ "$1" == apache2* ]] || [ "$1" == php-fpm ]; then +if [[ "$1" == apache2* || "$1" == php-fpm || "$1" == bin* ]]; then # docroot is empty if ! [ -e index.php -a -e bin/installto.sh ]; then echo >&2 "roundcubemail not found in $PWD - copying now..." diff --git a/nightly/docker-entrypoint.sh b/nightly/docker-entrypoint.sh index b76d8f0..f83a933 100755 --- a/nightly/docker-entrypoint.sh +++ b/nightly/docker-entrypoint.sh @@ -3,7 +3,7 @@ # PWD=`pwd` -if [[ "$1" == apache2* ]] || [ "$1" == php-fpm ]; then +if [[ "$1" == apache2* || "$1" == php-fpm || "$1" == bin* ]]; then # docroot is empty if ! [ -e index.php -a -e bin/installto.sh ]; then echo >&2 "roundcubemail not found in $PWD - copying now..." diff --git a/templates/docker-entrypoint.sh b/templates/docker-entrypoint.sh index 4ea2ff2..5aaba56 100644 --- a/templates/docker-entrypoint.sh +++ b/templates/docker-entrypoint.sh @@ -3,7 +3,7 @@ # PWD=`pwd` -if [[ "$1" == apache2* ]] || [ "$1" == php-fpm ]; then +if [[ "$1" == apache2* || "$1" == php-fpm || "$1" == bin* ]]; then # docroot is empty if ! [ -e index.php -a -e bin/installto.sh ]; then echo >&2 "roundcubemail not found in $PWD - copying now..."