-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-compose.yml
52 lines (48 loc) · 1.13 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
version: "3.8"
services:
mongodb:
image: mongo:7.0
container_name: userdb
restart: always
environment:
MONGO_INITDB_ROOT_USERNAME: root
MONGO_INITDB_ROOT_PASSWORD: password
ports:
- "27017:27017"
env_file: .env
volumes:
- mongo-data:/data/db
networks:
- backend_network
command: ["mongod", "--quiet", "--logpath", "/dev/null"]
express_backend:
build: .
container_name: express_backend_users
ports:
- "3001:3001"
env_file: .env
environment:
MONGO_URI: ${MONGO_URI}
depends_on:
- mongodb
networks:
- backend_network
volumes:
- ./:/app
test:
build: .
container_name: test_backend_users
command: ["npm", "run", "test"]
env_file: .env
volumes:
- ./:/app
depends_on:
- mongodb
networks:
- backend_network
profiles:
- testing
volumes:
mongo-data:
networks:
backend_network: