-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.yml
45 lines (42 loc) · 1.07 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
version: "3.8"
services:
server:
build:
dockerfile: ./docker/node.dockerfile
context: .
container_name: server_$PROJECT_NAME
image: server_$PROJECT_NAME
ports:
- "3000:3000"
volumes:
- ./:/app:rw
- /app/node_modules
networks:
- network
env_file:
- ./.env
depends_on:
- mongo
deploy:
resources:
limits:
cpus: '0.5'
memory: '512M'
mongo:
image: mongo:7.0.1
container_name: mongo_$PROJECT_NAME
environment:
- MONGO_INITDB_ROOT_USERNAME=$MONGO_USERNAME
- MONGO_INITDB_ROOT_PASSWORD=$MONGO_PASSWORD
ports:
- "27017:27017"
networks:
- network
volumes:
- /tmp/mongo/$PROJECT_NAME:/etc/mongo
- /tmp/data/$PROJECT_NAME:/data/db
restart: always
networks:
network:
driver: bridge
name: network_$PROJECT_NAME