Last active
March 22, 2019 00:01
-
-
Save edgarrmondragon/52bd5de15ba6da2577d24e7d740bad7e to your computer and use it in GitHub Desktop.
Working MongoDB seeding container in docker-compose
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
version: '3.3' | |
services: | |
# MongoDB | |
mongo: | |
image: mongo:3.6 | |
restart: always | |
# Seed MongoDB | |
mongo-seed: | |
build: | |
context: . | |
dockerfile: ./data/MongoDBSeed.Dockerfile | |
network_mode: "service:mongo" | |
depends_on: | |
- mongo | |
restart: on-failure |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FROM mongo:3.6 | |
ADD ./data/mongo_dump /mongo_dump | |
CMD mongorestore /mongo_dump |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment