Skip to content

Commit

Permalink
Added MongoDB
Browse files Browse the repository at this point in the history
  • Loading branch information
rbouma2 committed Mar 27, 2024
1 parent 34e8a70 commit 6af1995
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 1 deletion.
2 changes: 1 addition & 1 deletion bin/roll
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ declare ROLL_PARAMS=()
declare ROLL_CMD_VERB=
declare ROLL_CMD_EXEC=
declare ROLL_CMD_HELP=
declare ROLL_CMD_ANYARGS=(svc env db redis sync shell debug rootnotty rootshell clinotty root node npm cli copyfromcontainer copytocontainer composer grunt magento)
declare ROLL_CMD_ANYARGS=(svc env db redis sync shell debug rootnotty rootshell clinotty root node npm cli copyfromcontainer copytocontainer composer grunt magento magerun)

## parse first argument as command and determine validity
if (( "$#" )); then
Expand Down
3 changes: 3 additions & 0 deletions commands/env.cmd
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,9 @@ fi
[[ ${ROLL_DB} -eq 1 ]] \
&& appendEnvPartialIfExists "db"

[[ ${ROLL_MONGODB} -eq 1 ]] \
&& appendEnvPartialIfExists "mongodb"

[[ ${ROLL_ELASTICSEARCH} -eq 1 ]] \
&& appendEnvPartialIfExists "elasticsearch"

Expand Down
18 changes: 18 additions & 0 deletions environments/includes/mongodb.base.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
version: "3.9"
services:
php-fpm:
depends_on:
- mongodb

mongodb:
hostname: "${ROLL_ENV_NAME}-mongodb"
image: ${ROLL_IMAGE_REPOSITORY}/mongo:${MONGODB_VERSION:-7}
environment:
- MONGO_INITDB_ROOT_USERNAME=${MONGODB_ROOT_PASSWORD:-app}
- MONGO_INITDB_ROOT_PASSWORD=${MONGODB_ROOT_USER:-app}
- MONGO_INITDB_DATABASE=${MONGODB_DATABASE:-app}
volumes:
- mongodb:/data/db

volumes:
mongodb:
2 changes: 2 additions & 0 deletions environments/laravel/init.env
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,11 @@ COMPOSER_VERSION=1
PHP_VERSION=7.4
PHP_XDEBUG_3=1
REDIS_VERSION=5.0
MONGODB_VERSION=7

ROLL_DB=1
ROLL_REDIS=1
ROLL_MONGODB=0

## Laravel Config
APP_URL=http://app.$ROLL_ENV_NAME.test
Expand Down

0 comments on commit 6af1995

Please sign in to comment.