Skip to content

Commit 2094417

Browse files
authored
Remove own mongodb image and use original mongo image directly (#688)
1 parent 84ec180 commit 2094417

File tree

9 files changed

+37
-23
lines changed

9 files changed

+37
-23
lines changed

.gitignore

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,3 +26,9 @@ dev_run_migration.sh
2626

2727
development.json
2828
userimages*
29+
30+
# exclude everything
31+
dumps/*
32+
33+
# exception to the rule
34+
!dumps/.gitkeep
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
2+
#!/bin/bash
3+
4+
USER=${OSEM_dbuser:-"admin"}
5+
DATABASE=OSeM-api
6+
PASS=${OSEM_dbuserpass:-"admin"}
7+
8+
echo "Going to restore openSenseMap boxes export"
9+
mongorestore --db OSeM-api --username $USER --password $PASS --authenticationDatabase OSeM-api --gzip --archive=./exports/boxes
10+
echo "Export was restored"
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
#!/bin/bash
2+
3+
USER=${OSEM_dbuser:-"admin"}
4+
DATABASE=OSeM-api
5+
PASS=${OSEM_dbuserpass:-"admin"}
6+
7+
echo "Going to restore openSenseMap measurements export"
8+
mongorestore --db OSeM-api --username $USER --password $PASS --authenticationDatabase OSeM-api --gzip --archive=./exports/measurements
9+
echo "Export was restored"

CONTRIBUTING.md

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,11 +27,10 @@ To install all dependencies, run
2727

2828
### Starting the project locally
2929

30-
Before starting the development database, create the following network
30+
If you have some MongoDB dumps of `boxes` or `measurements` place them within the `dumps` folder and comment in the
31+
volume mappings within the `docker-compose.yml`. The dumps will be seeded for you.
3132

32-
docker network create api-db-network
33-
34-
Afterwards, start your development database
33+
Start your development database
3534

3635
docker-compose up -d
3736

docker-compose.yml

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,18 @@
11
version: "3.9"
22

3+
volumes:
4+
mongo-data:
5+
36
services:
47
db:
5-
build:
6-
context: ./images/mongodb
8+
image: mongo:5
79
container_name: osem-dev-mongo
810
ports:
911
- "27017:27017"
1012
volumes:
1113
- mongo-data:/data/db
12-
networks:
13-
- api-db-network
14-
15-
volumes:
16-
mongo-data:
17-
networks:
18-
api-db-network:
19-
external: true
14+
# - ./dumps/boxes:/exports/boxes
15+
# - ./dumps/measurements:/exports/measurements
16+
- ./.scripts/mongodb/osem_admin.sh:/docker-entrypoint-initdb.d/osem_admin.sh
17+
# - ./.scripts/mongodb/osem_seed_boxes.sh:/docker-entrypoint-initdb.d/osem_seed_boxes.sh
18+
# - ./.scripts/mongodb/osem_seed_measurements.sh:/docker-entrypoint-initdb.d/osem_seed_measurements.sh

dumps/.gitkeep

Whitespace-only changes.

images/mongodb/Dockerfile

Lines changed: 0 additions & 6 deletions
This file was deleted.

images/mongodb/README.md

Lines changed: 0 additions & 3 deletions
This file was deleted.

0 commit comments

Comments
 (0)