-
Notifications
You must be signed in to change notification settings - Fork 7
Expand file tree
/
Copy pathmongo.yml
More file actions
33 lines (29 loc) · 817 Bytes
/
mongo.yml
File metadata and controls
33 lines (29 loc) · 817 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
# Use root/example as user/password credentials
version: '3.4'
services:
mongo:
image: mongo:4.2
restart: always
command: ["--replSet", "main", "--bind_ip_all"]
hostname: mongodb
ports:
- 27017:27017
healthcheck:
test: test $$(echo "rs.initiate().ok || rs.status().ok" | mongo -u $${MONGO_INITDB_ROOT_USERNAME} -p $${MONGO_INITDB_ROOT_PASSWORD} --quiet) -eq 1
interval: 10s
start_period: 30s
volumes:
- mongo-db-data:/data/db
environment:
MONGO_INITDB_ROOT_USERNAME: root
MONGO_INITDB_ROOT_PASSWORD: example
mongo-express:
image: mongo-express:0.49
restart: always
ports:
- 8081:8081
environment:
ME_CONFIG_MONGODB_ADMINUSERNAME: root
ME_CONFIG_MONGODB_ADMINPASSWORD: example
volumes:
mongo-db-data: