-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose-prod.yml
More file actions
43 lines (39 loc) · 897 Bytes
/
docker-compose-prod.yml
File metadata and controls
43 lines (39 loc) · 897 Bytes
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
version: '3.7'
services:
mongo:
build:
context: ./mongo
dockerfile: Dockerfile
image: mongo-server
container_name: my-mongo-server
volumes:
- data-volume:/data/db
environment:
MONGO_INITDB_DATABASE: dbPortfolio
ports:
- "27017:27017"
networks:
- linkednetwork
app:
build:
context: ./
dockerfile: Dockerfile.prod
image: app-server
container_name: my-app-server
command: npm run production
volumes:
# bind mounting entire project folder to container for watcher detection
- ./:/usr/app
# node_modules gets its own volume for all containers to share
- node_modules_app:/usr/app/node_modules
ports:
- "3000:3000"
depends_on:
- mongo
networks:
- linkednetwork
volumes:
node_modules_app:
data-volume:
networks:
linkednetwork: