Add ROUNDCUBEMAIL_DB_PORT to fix #49

This commit is contained in:
mathieu.brunot 2019-06-01 15:53:57 +02:00
parent 0a06b301cf
commit e1670721d6
No known key found for this signature in database
GPG Key ID: 81584BEAF692D7E0
3 changed files with 11 additions and 5 deletions

View File

@ -32,7 +32,7 @@ By default, the image will use a local SQLite database for storing user account
It'll be created inside the `/var/www/html` directory and can be backed up from there. Please note that
this option should not be used for production environments.
### Connect to a MySQL Database
### Connect to a Database
The recommended way to run Roundcube is connected to a MySQL database. Specify the following env variables to do so:
@ -40,6 +40,8 @@ The recommended way to run Roundcube is connected to a MySQL database. Specify t
`ROUNDCUBEMAIL_DB_HOST` - Host (or Docker instance) name of the database service; defaults to `mysql` or `postgres` depending on linked containers.
`ROUNDCUBEMAIL_DB_PORT` - Port number of the database service; defaults to `3306` or `5432` depending on linked containers.
`ROUNDCUBEMAIL_DB_USER` - The database username for Roundcube; defaults to `root` on `mysql`
`ROUNDCUBEMAIL_DB_PASSWORD` - The password for the database connection

View File

@ -17,15 +17,17 @@ if [[ "$1" == apache2* ]] || [ "$1" == php-fpm ]; then
if [ ! -z "${!POSTGRES_ENV_POSTGRES_*}" ] || [ "$ROUNDCUBEMAIL_DB_TYPE" == "pgsql" ]; then
: "${ROUNDCUBEMAIL_DB_TYPE:=pgsql}"
: "${ROUNDCUBEMAIL_DB_HOST:=postgres}"
: "${ROUNDCUBEMAIL_DB_PORT:=5432}"
: "${ROUNDCUBEMAIL_DB_USER:=${POSTGRES_ENV_POSTGRES_USER}}"
: "${ROUNDCUBEMAIL_DB_PASSWORD:=${POSTGRES_ENV_POSTGRES_PASSWORD}}"
: "${ROUNDCUBEMAIL_DB_NAME:=${POSTGRES_ENV_POSTGRES_DB:-roundcubemail}}"
: "${ROUNDCUBEMAIL_DSNW:=${ROUNDCUBEMAIL_DB_TYPE}://${ROUNDCUBEMAIL_DB_USER}:${ROUNDCUBEMAIL_DB_PASSWORD}@${ROUNDCUBEMAIL_DB_HOST}/${ROUNDCUBEMAIL_DB_NAME}}"
/wait-for-it.sh ${ROUNDCUBEMAIL_DB_HOST}:5432 -t 30
/wait-for-it.sh ${ROUNDCUBEMAIL_DB_HOST}:${ROUNDCUBEMAIL_DB_PORT} -t 30
elif [ ! -z "${!MYSQL_ENV_MYSQL_*}" ] || [ "$ROUNDCUBEMAIL_DB_TYPE" == "mysql" ]; then
: "${ROUNDCUBEMAIL_DB_TYPE:=mysql}"
: "${ROUNDCUBEMAIL_DB_HOST:=mysql}"
: "${ROUNDCUBEMAIL_DB_PORT:=3306}"
: "${ROUNDCUBEMAIL_DB_USER:=${MYSQL_ENV_MYSQL_USER:-root}}"
if [ "$ROUNDCUBEMAIL_DB_USER" = 'root' ]; then
: "${ROUNDCUBEMAIL_DB_PASSWORD:=${MYSQL_ENV_MYSQL_ROOT_PASSWORD}}"
@ -35,7 +37,7 @@ if [[ "$1" == apache2* ]] || [ "$1" == php-fpm ]; then
: "${ROUNDCUBEMAIL_DB_NAME:=${MYSQL_ENV_MYSQL_DATABASE:-roundcubemail}}"
: "${ROUNDCUBEMAIL_DSNW:=${ROUNDCUBEMAIL_DB_TYPE}://${ROUNDCUBEMAIL_DB_USER}:${ROUNDCUBEMAIL_DB_PASSWORD}@${ROUNDCUBEMAIL_DB_HOST}/${ROUNDCUBEMAIL_DB_NAME}}"
/wait-for-it.sh ${ROUNDCUBEMAIL_DB_HOST}:3306 -t 30
/wait-for-it.sh ${ROUNDCUBEMAIL_DB_HOST}:${ROUNDCUBEMAIL_DB_PORT} -t 30
else
# use local SQLite DB in /var/www/html/db
: "${ROUNDCUBEMAIL_DB_TYPE:=sqlite}"

View File

@ -17,15 +17,17 @@ if [[ "$1" == apache2* ]] || [ "$1" == php-fpm ]; then
if [ ! -z "${!POSTGRES_ENV_POSTGRES_*}" ] || [ "$ROUNDCUBEMAIL_DB_TYPE" == "pgsql" ]; then
: "${ROUNDCUBEMAIL_DB_TYPE:=pgsql}"
: "${ROUNDCUBEMAIL_DB_HOST:=postgres}"
: "${ROUNDCUBEMAIL_DB_PORT:=5432}"
: "${ROUNDCUBEMAIL_DB_USER:=${POSTGRES_ENV_POSTGRES_USER}}"
: "${ROUNDCUBEMAIL_DB_PASSWORD:=${POSTGRES_ENV_POSTGRES_PASSWORD}}"
: "${ROUNDCUBEMAIL_DB_NAME:=${POSTGRES_ENV_POSTGRES_DB:-roundcubemail}}"
: "${ROUNDCUBEMAIL_DSNW:=${ROUNDCUBEMAIL_DB_TYPE}://${ROUNDCUBEMAIL_DB_USER}:${ROUNDCUBEMAIL_DB_PASSWORD}@${ROUNDCUBEMAIL_DB_HOST}/${ROUNDCUBEMAIL_DB_NAME}}"
/wait-for-it.sh ${ROUNDCUBEMAIL_DB_HOST}:5432 -t 30
/wait-for-it.sh ${ROUNDCUBEMAIL_DB_HOST}:${ROUNDCUBEMAIL_DB_PORT} -t 30
elif [ ! -z "${!MYSQL_ENV_MYSQL_*}" ] || [ "$ROUNDCUBEMAIL_DB_TYPE" == "mysql" ]; then
: "${ROUNDCUBEMAIL_DB_TYPE:=mysql}"
: "${ROUNDCUBEMAIL_DB_HOST:=mysql}"
: "${ROUNDCUBEMAIL_DB_PORT:=3306}"
: "${ROUNDCUBEMAIL_DB_USER:=${MYSQL_ENV_MYSQL_USER:-root}}"
if [ "$ROUNDCUBEMAIL_DB_USER" = 'root' ]; then
: "${ROUNDCUBEMAIL_DB_PASSWORD:=${MYSQL_ENV_MYSQL_ROOT_PASSWORD}}"
@ -35,7 +37,7 @@ if [[ "$1" == apache2* ]] || [ "$1" == php-fpm ]; then
: "${ROUNDCUBEMAIL_DB_NAME:=${MYSQL_ENV_MYSQL_DATABASE:-roundcubemail}}"
: "${ROUNDCUBEMAIL_DSNW:=${ROUNDCUBEMAIL_DB_TYPE}://${ROUNDCUBEMAIL_DB_USER}:${ROUNDCUBEMAIL_DB_PASSWORD}@${ROUNDCUBEMAIL_DB_HOST}/${ROUNDCUBEMAIL_DB_NAME}}"
/wait-for-it.sh ${ROUNDCUBEMAIL_DB_HOST}:3306 -t 30
/wait-for-it.sh ${ROUNDCUBEMAIL_DB_HOST}:${ROUNDCUBEMAIL_DB_PORT} -t 30
else
# use local SQLite DB in /var/www/html/db
: "${ROUNDCUBEMAIL_DB_TYPE:=sqlite}"