I use docker-compose to run my project created by node, mongodb, nginx;
and I built a project using docker build
and then I use docker up -d nginx to run my project. but I did not find the configuration to run the mongodb image using '--auth', so how do I add the '--auth' when creating the mongodb command?
here is my docker-compose.yml:
version: "2" services: mongodb: image: mongo:latest expose: - "27017" volumes: - "/home/open/mymongo:/data/db" nginx: build: /home/open/mynginx/ ports: - "8080:8080" - "80:80" links: - node_server:node node_server: build: /home/laoqiren/workspace/isomorphic-redux-CNode/ links: - mongodb:mongo expose: - "3000"
source share