mongoimport data in dockerfile code example
Example 1: mongodb docker import data
version: '3'
services:
mongodb:
image: mongo:3.2.6
ports:
- 27017:27017
mongo_seed:
image: mongo:3.2.6
links:
- mongodb
volumes:
- ./mongo-seed:/mongo-seed
command:
/mongo-seed/import.sh
Example 2: mongodb docker import data
#! /bin/bash
mongoimport --host mongodb --db test --collection census --type json --file /mongo-seed/census.json --jsonArray