Skip to content

Instantly share code, notes, and snippets.

@vishcious
Created November 9, 2018 19:28
Show Gist options
  • Save vishcious/1cec78fa5ab01091bb8c369c58a74df6 to your computer and use it in GitHub Desktop.
Save vishcious/1cec78fa5ab01091bb8c369c58a74df6 to your computer and use it in GitHub Desktop.
bootstrapping mongodb with indexes and seed data for integration test
db = new Mongo().getDB("XXX");
db.getCollection('YYY').createIndex({ pid: 1 }, { name: 'AAA' })
db.getCollection('YYY').createIndex({ v: 1 }, { name: 'BBB' })
db.getCollection('ZZZ').createIndex({ as: 1 }, { name: 'CCC' })
version: '3.6'
networks:
app_net:
name: marketplace
driver: bridge
driver_opts:
com.docker.network.enable_ipv6: "false"
services:
marketplace:
build: ./marketplace
networks:
- app_net
depends_on:
- mongom
environment:
- ASPNETCORE_ENVIRONMENT=Development
- CONSUL_HOST=${CONSUL_HOST:-http://consul.abc.corp:8500}
- MongoConnectionString=mongodb://mongom:27017/xxx
ports:
- "5000:5000"
volumes:
- ./out:/tmp
mockvendor:
build: ./mockvendor
networks:
- app_net
environment:
- CONSUL_HOST=${CONSUL_HOST:-http://consul.abc.corp:8500}
ports:
- "4000:4000"
taxcredit:
build: ./taxcredit
networks:
- app_net
depends_on:
- mongot
environment:
- ASPNETCORE_ENVIRONMENT=Development
- CONSUL_HOST=${CONSUL_HOST:-http://consul.abc.corp:8500}
- MONGO_CLUSTER=
- MongoConnectionString=mongodb://mongot:27017/ttt
- PartnerMarketplaceUrl=http://marketplace:5000
ports:
- "5001:5001"
mongom:
image: "mongo:3.4.10"
networks:
- app_net
ports:
- "27017:27017"
volumes:
- ./marketplace/db:/docker-entrypoint-initdb.d
environment:
- MONGO_INITDB_DATABASE=MarketPlace
mongot:
image: "mongo:3.4.10"
networks:
- app_net
ports:
- "27018:27017"
volumes:
- ./taxcredit/db:/docker-entrypoint-initdb.d
environment:
- MONGO_INITDB_DATABASE=yyy
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment