Skip to content

Instantly share code, notes, and snippets.

@piotrpolak
Created March 25, 2020 12:09
Show Gist options
  • Save piotrpolak/d92acc4bbdc94930f21406a6e5877051 to your computer and use it in GitHub Desktop.
Save piotrpolak/d92acc4bbdc94930f21406a6e5877051 to your computer and use it in GitHub Desktop.
version: '3.3'
services:
mongo:
image: mongo:4.2
ports:
- '27017-27019:27017-27019'
mongo-seed:
image: stefanwalther/mongo-seed
container_name: mongo-seed
environment:
- MONGODB_HOST=mongo
- MONGODB_PORT=27017
volumes:
- ./docker/mongo-db-seed:/data
depends_on:
- mongo
# https://docs.mongodb.com/manual/reference/program/mongoimport/
command: [
"mongoimport --host mongo --port 27017 --db dcim --mode upsert --type json --file /data/SOME_COLLECTION.json && ",
"mongoimport --host mongo --port 27017 --db dcim --mode upsert --type json --file /data/SOME_OTHER_COLLECTION.json"
]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment