-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.yml
46 lines (45 loc) · 945 Bytes
/
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.9'
services:
mongodb:
image: mongo
restart: always
ports:
- 27017:27017
environment:
MONGO_INITDB_ROOT_USERNAME: root
MONGO_INITDB_ROOT_PASSWORD: bolinho
MONGO_INITDB_LOG_LEVEL: warning
volumes:
- mongodb-data:/data/db
command: mongod --quiet --logpath /dev/null
app:
build:
context: .
dockerfile: Dockerfile
restart: always
ports:
- 3000:3000
environment:
NODE_ENV: production
MONGO_USERNAME: root
MONGO_PASSWORD: bolinho
MONGO_HOST: mongodb
depends_on:
- mongodb
volumes:
- ./src:/usr/src/app/src
- ./app.js:/usr/src/app/app.js
test:
build:
context: .
dockerfile: Dockerfile.test
environment:
NODE_ENV: test
MONGO_USERNAME: root
MONGO_PASSWORD: bolinho
MONGO_HOST: mongodb
depends_on:
- mongodb
- app
volumes:
mongodb-data: