-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathdocker-compose.yml
35 lines (32 loc) · 1.07 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
# Use root/example as user/password credentials
version: '3.1'
services:
mongo:
# dockerhub container image
# if we omit the version it will pull down the latest image
image: "mongo"
restart: always
ports:
# port forwarding
# localhost port : internal container port (in this case the port that mongo runs on in the container)
- 27017:27017
# Container env variables
environment:
MONGO_INITDB_ROOT_USERNAME: root
MONGO_INITDB_ROOT_PASSWORD: example
MONGO_INITDB_DATABASE: test_db
# Tell docker to mount and use the local folder to make the startup scripts available
# it will work through this dir in alphabetical order executing scripts due to this
# linking it to the docker container's folder /docker-entrypoint-initdb.d
volumes:
- ./docker/scripts:/docker-entrypoint-initdb.d
mongo-express:
image: mongo-express
restart: always
ports:
- 8888:8081
depends_on:
- mongo
environment:
ME_CONFIG_MONGODB_ADMINUSERNAME: root
ME_CONFIG_MONGODB_ADMINPASSWORD: example