Skip to content

Instantly share code, notes, and snippets.

@gabrielsaints
Created February 17, 2020 14:49
Show Gist options
  • Save gabrielsaints/5be7e337b978f6f2efe1bde19d1713b5 to your computer and use it in GitHub Desktop.
Save gabrielsaints/5be7e337b978f6f2efe1bde19d1713b5 to your computer and use it in GitHub Desktop.
Create a mongodb container with initial data using file named by import.js
version: "3"
services:
db_mongodb:
image: mongo
container_name: ze-delivery
ports:
- "27017:${MONGO_PORT}"
volumes:
- ./__data__:/data/db
import:
image: bwnyasse/docker-mongodb-worker
container_name: ze-delivery-import
command: "/start.sh -i"
environment:
- MONGO_HOST=db_mongodb
- MONGO_PORT=${MONGO_PORT}
- MONGO_DB_NAME=${MONGO_DB_NAME}
- MONGO_COLLECTION_NAME=pdvs
depends_on:
- db_mongodb
volumes:
- $PWD:/tmp/mongodb/:rw
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment