Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,6 @@


.DS_Store

# docker volumes
/dockervolume
9 changes: 8 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,8 @@ To run this server, you have to connect to a MongoDB database. Your server will
Two options for getting a MONGO_URI for development:

1. (most recommended) Sign up for Mongo Atlas yourself and create a databse for yourself, find the URI by going through the 'connect' flow.
2. Run a local MongoDB instance and connect.
2. Run a local MongoDB instance using Docker Compose with the command `docker compose up`.
3. Run a local MongoDB instance and connect.

### Set up .env

Expand All @@ -45,6 +46,12 @@ Set your `MONGO_URI` evironment variable in a `.env` file inside `server/`. If y
MONGO_URI="mongodb+srv://<username>:<password>@cluster0-cusns.mongodb.net/<database>?retryWrites=true&w=majority"
```

If you're using Docker Compose, set you `MONGO_URI` to:

```
MONGO_URI="mongodb://admin:password@localhost:27017?retryWrites=true&w=majority"
```

I put an example `.env` file in `.env.sample` feel free to `mv .env.sample .env` to get started.

### To Test
Expand Down
13 changes: 13 additions & 0 deletions docker-compose.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
version: '3'
services:
mongo:
image: mongo:5.0
restart: always
ports:
- 27017:27017
environment:
- MONGO_INITDB_ROOT_USERNAME=admin
- MONGO_INITDB_ROOT_PASSWORD=password
container_name: mongo
volumes:
- './dockervolume/mongodb:/data/db'
1 change: 1 addition & 0 deletions server/.env.sample
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
MONGO_URI="mongodb://admin:password@localhost:27017?retryWrites=true&w=majority"