docker operations
This commit is contained in:
parent
f408381266
commit
7bfd73f505
7
.gitignore
vendored
7
.gitignore
vendored
@ -1,3 +1,6 @@
|
||||
./archivar
|
||||
inventory/
|
||||
./serra
|
||||
_db/*
|
||||
!_db/.placeholder
|
||||
_backup/*
|
||||
!_backup/.placeholder
|
||||
dist/
|
||||
|
||||
0
_backup/.placeholder
Normal file
0
_backup/.placeholder
Normal file
0
_db/.placeholder
Normal file
0
_db/.placeholder
Normal file
@ -10,8 +10,21 @@ services:
|
||||
MONGO_INITDB_ROOT_USERNAME: root
|
||||
MONGO_INITDB_ROOT_PASSWORD: root
|
||||
volumes:
|
||||
- mongodb:/data/db
|
||||
- 'mongodb:/data/db'
|
||||
- 'mongodbbackup:/backup'
|
||||
|
||||
volumes:
|
||||
mongodb:
|
||||
driver: local
|
||||
driver_opts:
|
||||
type: none
|
||||
device: "$PWD/_db"
|
||||
o: bind
|
||||
|
||||
mongodbbackup:
|
||||
driver: local
|
||||
driver_opts:
|
||||
type: none
|
||||
device: "$PWD/_backup"
|
||||
o: bind
|
||||
|
||||
|
||||
11
readme.md
11
readme.md
@ -9,7 +9,6 @@
|
||||
|
||||
mvp
|
||||
|
||||
* refactor storage to have a storage object.
|
||||
* single view for card, with history
|
||||
* docker with local mounted volume and git ignore
|
||||
* mongodb backup container
|
||||
@ -29,3 +28,13 @@ optional
|
||||
Find cards that increased prices
|
||||
|
||||
db.cards.find({$expr: {$gt: [{$arrayElemAt: ["$serra_prices", -2]}, {$arrayElemAt: ["$serra_prices", -1]}]}}, {name:1})
|
||||
|
||||
# MongoDB Operations
|
||||
|
||||
Do a database dump
|
||||
|
||||
mongodump -u root -p root --authenticationDatabase admin -d serra -o /backup/
|
||||
|
||||
Do a collection export to json
|
||||
|
||||
mongoexport -u root -p root --authenticationDatabase admin -d serra -c cards
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user