Skip to content

Commit

Permalink
added initdb user and password to initialize scripts in Mongo.
Browse files Browse the repository at this point in the history
  • Loading branch information
hantsy committed Aug 21, 2018
1 parent f267dc9 commit 0588e37
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions mongo-rep-set.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,26 +5,28 @@
container_name: localmongo1
image: mongo:4.0-xenial
environment:
MONGO_INITDB_ROOT_USERNAME: root
MONGO_INITDB_ROOT_PASSWORD: root
MONGO_INITDB_DATABASE: blog
volumes:
- ./mongo-initdb.d:/docker-entrypoint-initdb.d
- ./mongo-initdb.d:/docker-entrypoint-initdb.d
ports:
- "27017:27017"
restart: always
entrypoint: [ "/usr/bin/mongod", "--bind_ip_all", "--replSet", "rs0" ]
command: --bind_ip_all --replSet rs0
mongo2:
hostname: mongo2
container_name: localmongo2
image: mongo:4.0-xenial
ports:
- "27018:27017"
restart: always
entrypoint: [ "/usr/bin/mongod", "--bind_ip_all", "--replSet", "rs0" ]
command: --bind_ip_all --replSet rs0
mongo3:
hostname: mongo3
container_name: localmongo3
image: mongo:4.0-xenial
ports:
- "27019:27017"
restart: always
entrypoint: [ "/usr/bin/mongod", "--bind_ip_all", "--replSet", "rs0" ]
command: --bind_ip_all --replSet rs0

0 comments on commit 0588e37

Please sign in to comment.