-
Notifications
You must be signed in to change notification settings - Fork 15
/
docker-compose.yml
46 lines (40 loc) · 1.06 KB
/
docker-compose.yml
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
34
35
36
37
38
39
40
41
42
43
44
45
46
version: '3.3'
# Usage:
# docker stack deploy -c stack.yml mongo
# or
# docker-compose -f stack.yml up
services:
mongo:
image: mongo
restart: always
container_name: mongo-docker
environment:
MONGO_INITDB_ROOT_USERNAME: mongoadmin
MONGO_INITDB_ROOT_PASSWORD: mongoadmin
#MONGODB_AUTH_DATABASE: admin
ports:
- "27017:27017"
volumes:
- ./workspace:/workspace
- type: volume
source: mongodb_data_volume
target: /data/db
mongo-express:
image: mongo-express
container_name: mongo-express
restart: always
ports:
- "28081:8081"
environment:
ME_CONFIG_MONGODB_SERVER: mongo
ME_CONFIG_BASICAUTH_USERNAME: admin
ME_CONFIG_BASICAUTH_PASSWORD: changeme
#ME_CONFIG_MONGODB_AUTH_DATABASE: admin
ME_CONFIG_MONGODB_ADMINUSERNAME: mongoadmin
ME_CONFIG_MONGODB_ADMINPASSWORD: mongoadmin
ME_CONFIG_MONGODB_URL: mongo://mongoadmin:mongoadmin@mongo:27017/
depends_on:
- mongo
volumes:
mongodb_data_volume:
driver: local