forked from flaviuse/mern-authentication
-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.yml
37 lines (37 loc) · 1010 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
version: "3"
services:
mongo:
image: mongo:latest
ports:
- "20717:20717"
volumes:
- /data/db # Create a volume for the DB.
client:
container_name: client
build:
context: ./client
dockerfile: Dockerfile
ports:
- "3000:3000"
restart: always
env_file:
- client.env
restart: always
stdin_open: true # Hot reloading create react app: https://github.com/facebook/create-react-app/issues/8688#issuecomment-602110747
volumes:
- ./client:/app #Synchronise docker container with local change
- /app/node_modules #Avoid re-copying local node_modules. Cache in volume.
server:
build:
context: ./server
dockerfile: Dockerfile
depends_on:
- mongo
env_file:
- server.env
ports:
- "8081:8081"
restart: always
volumes:
- ./server:/app #Synchronise docker container with local change
- /app/node_modules #Avoid re-copying local node_modules. Cache in volume.