-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-compose.yaml
48 lines (46 loc) · 1.06 KB
/
docker-compose.yaml
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
services:
frontend:
build:
context: './client'
dockerfile: Dockerfile
ports:
- ${FRONTEND_HOST_PORT}:${FRONTEND_CONTAINER_PORT}
container_name: ${APP_NAME}-frontend-container
networks:
- mern-stack-network
volumes:
- ./client:/app
- /app/node_modules
depends_on:
- backend
backend:
build:
context: './api'
dockerfile: Dockerfile
ports:
- ${BACKEND_HOST_PORT}:${BACKEND_CONTAINER_PORT}
container_name: ${APP_NAME}-api-container
networks:
- mern-stack-network
volumes:
- ./api:/app
- /app/node_modules
depends_on:
- mongo
mongo:
image: mongo
ports:
- ${MONGO_HOST_PORT}:${MONGO_CONTAINER_PORT}
container_name: mongo-container
networks:
- mern-stack-network
volumes:
- mongoData:/data/db
environment:
- MONGO_INITDB_ROOT_USERNAME=${MONGO_USERNAME}
- MONGO_INITDB_ROOT_PASSWORD=${MONGO_PASSWORD}
- MONGO_INITDB_DATABASE=${MONGO_DATABASE}
networks:
mern-stack-network:
volumes:
mongoData: