Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
menu search
person
Welcome To Ask or Share your Answers For Others

Categories

I created a docker-compose.yml to pull a bunch of apis and initialize a mongo db instance with some pre-pupulated data, have my docker-compose file, and my mongo-init.js file is located in the root of the project (src/mongo-init.js)

it builds the project and seeds the database, but it also creates extra folders and files in the project I wasn't expecting, a .docker/mongodb/initdb.d directory, and a mongo directory with init-mongo.js and mongo-volume which has a bunch of files in, index-1--441...wt, WiredTiger.lock, etc

  • docker-compose.yaml
version: '3.4'
services:
  mongo:
    image: mongo:latest
    container_name: mongodb
    hostname: mongodb
    ports:
      - '27017-27019:27017-27019'
    volumes:
      - ./mongo-init.js:/docker-entrypoint-initdb.d/mongo-init.js:ro

thanks in advance for any help


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
400 views
Welcome To Ask or Share your Answers For Others

1 Answer

等待大神答复

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
...