forked from jtweaver/mern-docker
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-compose.yml
49 lines (48 loc) · 1.11 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
47
48
49
version: "3"
services:
mern:
container_name: mern
restart: always
image: jtweaver/mern-docker
build:
context: .
dockerfile: mern.dockerfile
ports:
- "5000:5000"
links:
- mongo
depends_on:
- mongo
environment:
- NODE_ENV=production
- WAIT_HOSTS=mongo:27017
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:5000/"]
command: ["npm", "run", "prod"]
nosql:
container_name: nosql
image: mongoclient/mongoclient
ports:
- "5300:3000"
links:
- mongo
depends_on:
- mongo
environment:
- MONGO_USERNAME=mernUser
- MONGO_PASSWORD=password
- MONGO_ADDRESSES=mongo
- MONGO_OPT_PARAMS=authSource=admin
- MONGO_DATABASE=mern
# - MONGO_URL=mongodb://mernUser:password@mongo-ip:27017/mern?authSource=admin
mongo:
container_name: mongo
image: mongo
volumes:
- ./data:/data/db
ports:
- "27017:27017"
environment:
- MONGO_INITDB_ROOT_USERNAME=mernUser
- MONGO_INITDB_ROOT_PASSWORD=password
- MONGO_INITDB_DATABASE=mern