version: '3'

services:

    web:
      image: reactql-app
      restart: always
      build:
        context: ./client
        dockerfile: Dockerfile
      volumes:
        - ./client:/usr/src/app
      user: node
      ports: 
        - "3000:3000"
      command: yarn start
      depends_on:
        - server

    server:
      image: reactql-server
      restart: always
      build:
        context: ./server
        dockerfile: Dockerfile-server
      volumes:
        - ./server:/usr/src/app
      user: node
      ports: 
        - "8080:8080"
      command: yarn start
      depends_on:
        - db
      environment:
        - DB_HOST=db

    db:
      image: mongo

version: '3'

services:
    web:
      image: reactql-app
      restart: always
      build:
        context: ./client
        dockerfile: Dockerfile
      volumes:
        - ./client:/usr/src/app
      user: node
      ports:
        - "3000:3000"
      command: yarn start
      depends_on:
        - server

    server:
      image: reactql-server
      restart: always
      build:
        context: ./server
        dockerfile: Dockerfile-server
      volumes:
        - ./server:/usr/src/app
      user: node
      ports:
        - "8080:8080"
      command: yarn start
      depends_on:
        - db
      environment:
        - DB_HOST=db

    db:
      image: mongo
      ports:
        - "27017:27017"
      volumes:
        - mongodata:/data/db

    mongodata:
      image: tianon/true
      volumes:
        - mongodata:/data/db
        
volumes:
    mongodata:

Add database storing data storing layer
Add database storing data storing layer
