-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathdocker-compose.yml
43 lines (40 loc) · 1.12 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
version: '3.1'
services:
mongo:
container_name: mongo
image: mongo:4.0.10
restart: always
ports:
- "27017:27017"
environment:
MONGO_INITDB_ROOT_USERNAME: root
MONGO_INITDB_ROOT_PASSWORD: toor
MONGO_INITDB_DATABASE: lottoWebDataBase
volumes:
- ./init-mongo.js:/docker-entrypoint-initdb.d/init-mongo.js:ro
mongo-express:
image: mongo-express
restart: always #restart the container regardless of the exit status
ports:
- "8081:8081" # port forwarding
depends_on:
- mongo
environment:
ME_CONFIG_MONGODB_ADMINUSERNAME: root
ME_CONFIG_MONGODB_ADMINPASSWORD: toor
ME_CONFIG_MONGODB_URL: mongodb://root:toor@mongo:27017/ # mongodb://{mongo-image-username}:{mongo-image-password}@{mongo-image-name}:{port}
lotto:
container_name: lotto
build: .
restart: always
ports:
- "8000:8000"
depends_on:
- mongo
environment:
MONGO_USER: lottoWebUser
MONGO_PASSWORD: lottoWebPassword
MONGO_HOST: mongo
MONGO_PORT: 27017
MONGO_DB_NAME: lottoWebDataBase
MONGO_AUTH_SOURCE: admin