From f5de4748bd5b5cff563a9534de974c1bb0f9b63d Mon Sep 17 00:00:00 2001 From: Alfredo Di Napoli Date: Tue, 25 Apr 2017 09:31:49 +0100 Subject: [PATCH] Fixed #2 (Make MongoDB port configurable) --- Dockerfile | 2 +- docker-entrypoint.sh | 7 +++++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/Dockerfile b/Dockerfile index f4f50ca..5636fe8 100644 --- a/Dockerfile +++ b/Dockerfile @@ -12,7 +12,7 @@ COPY conf/supervisord.conf /etc/ # Install the PHP extensions we need #RUN docker-php-ext-configure gd --with-png-dir=/usr --with-jpeg-dir=/usr -RUN docker-php-ext-install opcache zip mcrypt mbstring > /dev/null 2>&1 +RUN docker-php-ext-install pcntl bcmath opcache zip mcrypt mbstring > /dev/null 2>&1 # Install PHP pecl mongo COPY bin/* /usr/local/bin/ diff --git a/docker-entrypoint.sh b/docker-entrypoint.sh index 8c6d99b..f877d61 100755 --- a/docker-entrypoint.sh +++ b/docker-entrypoint.sh @@ -56,6 +56,9 @@ set -e # "${LEARNINGLOCKER_DB_HOST}/admin" < /tmp/createUser.js # rm /tmp/createUser.js + # Set the MongoDB port to a default value if the user didn't provide one + LEARNINGLOCKER_DB_PORT=${LEARNINGLOCKER_DB_PORT:-27017} + # Setup database connection to mongodb if [ ! -e app/config/local/database.php ]; then if [ -z "$LEARNINGLOCKER_DB_REPLICA_SET" ]; then @@ -66,7 +69,7 @@ set -e 'mongodb' => [ 'driver' => 'mongodb', 'host' => '${LEARNINGLOCKER_DB_HOST}', - 'port' => 27017, + 'port' => '${LEARNINGLOCKER_DB_PORT}', 'database' => '$LEARNINGLOCKER_DB_NAME', 'username' => '${LEARNINGLOCKER_DB_USER}', 'password' => '${LEARNINGLOCKER_DB_PASSWORD}' @@ -82,7 +85,7 @@ set -e 'mongodb' => [ 'driver' => 'mongodb', 'host' => array(${LEARNINGLOCKER_DB_HOST}), - 'port' => 27017, + 'port' => '${LEARNINGLOCKER_DB_PORT}', 'database' => '$LEARNINGLOCKER_DB_NAME', 'username' => '${LEARNINGLOCKER_DB_USER}', 'password' => '${LEARNINGLOCKER_DB_PASSWORD}',