-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-compose.yml
53 lines (48 loc) · 1.09 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
50
51
52
53
version: '3.9'
services:
app:
container_name: clean-node-api
build:
context: .
dockerfile: Dockerfile
image: clean-node-api:0.1.0
restart: always
command: npm run seed
env_file:
- .env
environment:
MONGO_URL: mongodb://cleanuser:clean1234@localhost:27017/cleandb
PORT: 3000
TOKEN_SECRET: secret
ports:
- 3000:3000
networks:
- clean-node-network
depends_on:
- db
db:
container_name: clean-node-api-db
image: mongo:latest
restart: always
ports:
- 27017:27017
environment:
MONGO_INITDB_ROOT_USERNAME: root
MONGO_INITDB_ROOT_PASSWORD: 1234
volumes:
- data:/data/db
networks:
- clean-node-network
dbClientTemp:
image: mongo:latest
container_name: db-client-temp
links:
- db
command: mongo -u root -p 1234 --host localhost --eval "db.getSiblingDB('cleandb').createUser({user:'cleanuser', pwd:'clean1234', roles:[{role:'readWrite',db:'cleandb'}]});"
depends_on:
- db
networks:
clean-node-network:
driver: bridge
volumes:
data: