Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,6 @@ Mongo Express can now be started on demand using the `ddev mongo-express` comman

## Caveats:

- The php extension (`phpX.X-mongodb`) is set up in `.ddev/config.mongo.yaml` using `webimage_extra_packages`. You may want to edit your `.ddev/config.yaml` to do what you want and remove the `.ddev/config.mongo.yaml`.
- You can't define custom MongoDB configuration with this current setup.
- You can't use `ddev import-db` to import to mongo.

Expand Down
2 changes: 2 additions & 0 deletions config.mongo.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
#ddev-generated
webimage_extra_packages: ["php${DDEV_PHP_VERSION}-mongodb"]
17 changes: 6 additions & 11 deletions install.yaml
Original file line number Diff line number Diff line change
@@ -1,24 +1,19 @@
name: mongo

pre_install_actions:
- |
#ddev-description:Create config.mongo.yaml with webimage_extra_packages in it
printf '#ddev-generated\nwebimage_extra_packages: ["php${DDEV_PHP_VERSION}-mongodb"]\n' >.ddev/config.mongo.yaml
project_files:
- commands/mongo/mongosh
- commands/host/mongo-express
- config.mongo.yaml
- docker-compose.mongo.yaml
- docker-compose.mongo_norouter.yaml

ddev_version_constraint: '>= v1.24.4'

post_install_actions:
- |
#ddev-description:If router disabled, directly expose port
#
if ( {{ contains "ddev-router" (list .DdevGlobalConfig.omit_containers | toString) }} ); then
printf "#ddev-generated\nservices:\n mongo-express:\n ports:\n - 9091:8081\n" > docker-compose.mongo_norouter.yaml
fi
- |
echo "You can now use 'ddev mongo-express' to launch Mongo Express UI"

project_files:
- commands/mongo/mongosh
- commands/host/mongo-express
- docker-compose.mongo.yaml
- docker-compose.mongo_norouter.yaml