version: '3'
services:
  todoapp1:
    container_name: todoapp1
    restart: always
    build: ./
    volumes:
      - ./:/var/www/todoapp
    links:
      - mongo
    ports:
      - 3000:3000
    environment:
      - NODE_ENV=development
      - PORT=3000
  
  todoapp2:
    container_name: todoapp2
    restart: always
    build: ./
    volumes:
      - ./:/var/www/todoapp
    links:
      - mongo
    ports:
      - 3001:3000
    environment:
      - NODE_ENV=development
      - PORT=3000
  
  mongo:
    image: mongo
    container_name: mongo
    ports:
      - "27017:27017"