Skip to content

Commit

Permalink
Add MongoDB extension and service to Docker (#1717)
Browse files Browse the repository at this point in the history
* Add MongoDB extension and service to Docker

* replace docker-compose.yml by compose.yaml
  • Loading branch information
GromNaN authored Nov 30, 2024
1 parent ced9674 commit f173e2b
Show file tree
Hide file tree
Showing 2 changed files with 64 additions and 0 deletions.
32 changes: 32 additions & 0 deletions doctrine/mongodb-odm-bundle/4.4/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,39 @@
"env(MONGODB_DB)": ""
},
"env": {
"#1": "Format described at https://www.mongodb.com/docs/php-library/current/connect/connection-options/",
"#2": "MONGODB_URL=\"mongodb://username:password@localhost:27017/?authSource=auth-db\"",
"#3": "MONGODB_URL=\"mongodb+srv://username:password@YOUR_CLUSTER_NAME.YOUR_HASH.mongodb.net/?retryWrites=true&w=majority\"",
"MONGODB_URL": "mongodb://localhost:27017",
"MONGODB_DB": "symfony"
},
"dockerfile": [
"RUN install-php-extensions mongodb"
],
"docker-compose": {
"compose.yaml": {
"services": [
"mongodb:",
" # In production, you may want to use a managed database service",
" image: mongodb/mongodb-community-server:latest",
" environment:",
" - MONGODB_INITDB_DATABASE=${MONGODB_DB:-app}",
" # You should definitely set a root username and password in production",
" - MONGODB_INITDB_ROOT_USERNAME=${MONGODB_USERNAME:-}",
" - MONGODB_INITDB_ROOT_PASSWORD=${MONGODB_PASSWORD:-}",
" volumes:",
" - mongodb_data:/data/db:rw",
" # You may use a bind-mounted host directory instead, so that it is harder to accidentally remove the volume and lose all your data!",
" # - ./docker/mongodb/data:/data/db:rw"
],
"volumes": ["mongodb_data:"]
},
"compose.override.yaml": {
"services": [
"mongodb:",
" ports:",
" - \"27017\""
]
}
}
}
32 changes: 32 additions & 0 deletions doctrine/mongodb-odm-bundle/5.0/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,39 @@
"env(MONGODB_DB)": ""
},
"env": {
"#1": "Format described at https://www.mongodb.com/docs/php-library/current/connect/connection-options/",
"#2": "MONGODB_URL=\"mongodb://username:password@localhost:27017/?authSource=auth-db\"",
"#3": "MONGODB_URL=\"mongodb+srv://username:password@YOUR_CLUSTER_NAME.YOUR_HASH.mongodb.net/?retryWrites=true&w=majority\"",
"MONGODB_URL": "mongodb://localhost:27017",
"MONGODB_DB": "symfony"
},
"dockerfile": [
"RUN install-php-extensions mongodb"
],
"docker-compose": {
"compose.yaml": {
"services": [
"mongodb:",
" # In production, you may want to use a managed database service",
" image: mongodb/mongodb-atlas-local:latest",
" environment:",
" - MONGODB_INITDB_DATABASE=${MONGODB_DB:-app}",
" # You should definitely set a root username and password in production",
" - MONGODB_INITDB_ROOT_USERNAME=${MONGODB_USERNAME:-}",
" - MONGODB_INITDB_ROOT_PASSWORD=${MONGODB_PASSWORD:-}",
" volumes:",
" - mongodb_data:/data/db:rw",
" # You may use a bind-mounted host directory instead, so that it is harder to accidentally remove the volume and lose all your data!",
" # - ./docker/mongodb/data:/data/db:rw"
],
"volumes": ["mongodb_data:"]
},
"compose.override.yaml": {
"services": [
"mongodb:",
" ports:",
" - \"27017\""
]
}
}
}

0 comments on commit f173e2b

Please sign in to comment.