File tree Expand file tree Collapse file tree 2 files changed +39
-0
lines changed
Expand file tree Collapse file tree 2 files changed +39
-0
lines changed Original file line number Diff line number Diff line change 1+ {
2+ "name" : " freeCodeCampDC" ,
3+ "dockerComposeFile" : " docker-compose.yml" ,
4+ "service" : " devcontainer" ,
5+ "workspaceFolder" : " /workspaces/${localWorkspaceFolderBasename}" ,
6+ // "features": {},
7+ "forwardPorts" : [3000 , 8000 ]
8+ }
Original file line number Diff line number Diff line change 1+ services :
2+ devcontainer :
3+ depends_on :
4+ - mongo-db
5+ - mongo-setup
6+ image : mcr.microsoft.com/devcontainers/typescript-node:22
7+ volumes :
8+ - ../..:/workspaces:cached
9+ network_mode : service:mongo-db
10+ command : sleep infinity
11+
12+ mongo-db :
13+ image : mongo
14+ command : mongod --replSet rs0
15+ restart : unless-stopped
16+ volumes :
17+ - mongodb-data:/data/db
18+ mongo-setup :
19+ image : mongo
20+ depends_on :
21+ - mongo-db
22+ restart : on-failure
23+ entrypoint : [
24+ ' bash' ,
25+ ' -c' ,
26+ # This will try to initiate the replica set, until it succeeds twice (i.e. until the replica set is already initialized)
27+ ' mongosh --host mongo-db:27017 --eval '' try {rs.initiate();} catch (err) { if(err.codeName !== "AlreadyInitialized") throw err };'' '
28+ ]
29+
30+ volumes :
31+ mongodb-data :
You can’t perform that action at this time.
0 commit comments