File tree Expand file tree Collapse file tree 3 files changed +25
-5
lines changed
Expand file tree Collapse file tree 3 files changed +25
-5
lines changed Original file line number Diff line number Diff line change @@ -48,6 +48,18 @@ services:
4848 - MONGO_URI # empty values are read from defang config
4949` ` `
5050
51+ ### Using DocumentDB in AWS
52+
53+ If you want to use DocumentDB in AWS, you can add the ` x-defang-mongodb` extension to your `compose.yaml` file:
54+
55+ ` ` ` yaml
56+ services:
57+ db:
58+ x-defang-mongodb: true
59+ ` ` `
60+
61+ This will automatically provision a DocumentDB cluster in your AWS account.
62+
5163# # Deployment
5264
5365> [!NOTE]
Original file line number Diff line number Diff line change @@ -9,10 +9,8 @@ services:
99 target : 8080
1010 published : 8080
1111 environment :
12- # If you want to use MongoDB Atlas, you can set the URI with `defang config set MONGO_URI`
13- # and remove the value from the MONGO_URI environment variable so that it is read from defang
14- # config. For example:
15- # - MONGO_URI
12+ # If you want to use MongoDB Atlas, you can set the URI with `defang config set MONGO_URI`.
13+ # This will override any value set in the environment variable:
1614 - MONGO_URI=mongodb://$MONGO_INITDB_ROOT_USERNAME:$MONGO_INITDB_ROOT_PASSWORD@db:27017/
1715 # deploy:
1816 # resources:
@@ -24,11 +22,19 @@ services:
2422 - db
2523
2624 db :
27- image : mongo:8.0.3
25+ image : mongo:5
2826 restart : unless-stopped
2927 ports :
3028 - mode : host
3129 target : 27017
3230 environment :
3331 - MONGO_INITDB_ROOT_USERNAME
3432 - MONGO_INITDB_ROOT_PASSWORD
33+ volumes :
34+ - db_data:/data/db
35+ # The following option will provision a managed MongoDB instance, eg. DocumentDB on AWS.
36+ x-defang-mongodb : true
37+
38+ volumes :
39+ db_data :
40+ driver : local
Original file line number Diff line number Diff line change @@ -36,6 +36,8 @@ services:
3636 # resources:
3737 # reservations:
3838 # memory: 256M
39+ # The following option will provision a managed MongoDB instance, eg. DocumentDB on AWS.
40+ x-defang-mongodb : true
3941
4042volumes :
4143 mongo-data :
You can’t perform that action at this time.
0 commit comments