Skip to content

Added docker container instructions for mongodb data #13

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
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
26 changes: 25 additions & 1 deletion _docs/Backend/gettingstarted.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ In env file

1. [Download some Mongo data to use locally](https://www.dropbox.com/sh/5o1193iesmiul9v/AADKLQgkZBlQzjHk6mBBnp6Da?dl=0) and unzip

Populate the database by running _mongorestore --db sed-test sed-test-db_
Populate the database by running _mongorestore -d sed-test sed-test-db_

2. Install and run the node project.

Expand All @@ -36,6 +36,30 @@ Populate the database by running _mongorestore --db sed-test sed-test-db_

_(Then check package.json for other builds)_

#### In Docker ####

When using the `docker-compose up` method for the backend, there a few differences when restoring the data.

First, install curl and unzip into the mongodb docker container.

```
docker exec -it sedaily-mongo apt update

docker exec -it sedaily-mongo apt install curl unzip
```

Then download the [database data](https://www.dropbox.com/sh/5o1193iesmiul9v/AADKLQgkZBlQzjHk6mBBnp6Da?dl=0) (you may need to download then rehost it somewhere "curl friendly") `docker exec -it sedaily-mongo curl <zip file url> -o /tmp/db.zip`.

Finally, unzip the file and restore it into the database.

```
docker exec -it sedaily-mongo unzip /tmp/db.zip -d /tmp/db

docker exec -it sedaily-mongo mongorestore -d express-mongoose-es6-rest-api-development /tmp/db
```

Then you can manipulate post data as usual.

### Test the Backend ###

1. use curl or Postman to make requests
Expand Down