Skip to content
This repository was archived by the owner on Nov 6, 2024. It is now read-only.

Commit

Permalink
feat: Add docker-compose file for MongoDB
Browse files Browse the repository at this point in the history
  • Loading branch information
jhordyess committed Sep 18, 2024
1 parent 88bfba3 commit 92c0541
Showing 1 changed file with 33 additions and 0 deletions.
33 changes: 33 additions & 0 deletions docker-compose.mongo.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
services:
mongodb:
image: mongo:6.0
container_name: mern-crud-mongo
environment:
- MONGO_INITDB_ROOT_USERNAME
- MONGO_INITDB_ROOT_PASSWORD
- MONGO_REPLICA_ID=rs0
- MONGO_REPLICA_HOST=mongodb
volumes:
- type: bind
source: ./database/init.sh
target: /scripts/init.sh
- type: volume
source: mongodb-data
target: /data/db
- type: volume
source: mongodb-config
target: /data/configdb
command: "/scripts/init.sh"
ports:
- "27017:27017"
networks:
- localnet

volumes:
mongodb-data:
mongodb-config:


networks:
localnet:
driver: bridge

0 comments on commit 92c0541

Please sign in to comment.