File tree Expand file tree Collapse file tree 2 files changed +23
-5
lines changed Expand file tree Collapse file tree 2 files changed +23
-5
lines changed Original file line number Diff line number Diff line change @@ -48,6 +48,18 @@ services:
48
48
- MONGO_URI # empty values are read from defang config
49
49
` ` `
50
50
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
+
51
63
# # Deployment
52
64
53
65
> [!NOTE]
Original file line number Diff line number Diff line change @@ -9,10 +9,8 @@ services:
9
9
target : 8080
10
10
published : 8080
11
11
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:
16
14
- MONGO_URI=mongodb://$MONGO_INITDB_ROOT_USERNAME:$MONGO_INITDB_ROOT_PASSWORD@db:27017/
17
15
# deploy:
18
16
# resources:
@@ -24,11 +22,19 @@ services:
24
22
- db
25
23
26
24
db :
27
- image : mongo:8.0.3
25
+ image : mongo:5
28
26
restart : unless-stopped
29
27
ports :
30
28
- mode : host
31
29
target : 27017
32
30
environment :
33
31
- MONGO_INITDB_ROOT_USERNAME
34
32
- 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
You can’t perform that action at this time.
0 commit comments