Skip to content

Commit

Permalink
Fixed #2 (Make MongoDB port configurable)
Browse files Browse the repository at this point in the history
  • Loading branch information
adinapoli committed Apr 25, 2017
1 parent 6bb9c4e commit f5de474
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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/
Expand Down
7 changes: 5 additions & 2 deletions docker-entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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}'
Expand All @@ -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}',
Expand Down

0 comments on commit f5de474

Please sign in to comment.