/ inception / practice / bindmount-apps / compose.yaml
compose.yaml
 1  # Comments are provided throughout this file to help you get started.
 2  # If you need more help, visit the Docker compose reference guide at
 3  # https://docs.docker.com/compose/compose-file/
 4  
 5  # Here the instructions define your application as two services called "todo-app" and “todo-database”
 6  # The service “todo-app” is built from the Dockerfile in the /app directory,
 7  # and the service “todo-database” uses the official MongoDB image 
 8  # from Docker Hub - https://hub.docker.com/_/mongo. 
 9  # You can add other services your application may depend on here.
10  
11  services:
12    todo-app:
13      build:
14        context: ./app
15      links:
16        - todo-database
17      volumes: 
18        - ./app:/usr/src/app
19        - /usr/src/app/node_modules
20      ports:
21        - 3001:3001
22  
23    todo-database:
24      image: mongo:6
25      command: mongod --port 27018
26      ports:
27        - 27018:27018