version: "3"

services:
  app:
    env_file:
      - ./app/.env
    environment:
      - HTTP_PORT=$HTTP_PORT
    build: ./app
    restart: always
    links:
      - redis
    command: npm start
    working_dir: /usr/app
    volumes:
      - app:/app
    ports:
      - "127.0.0.1:9229:9229" # V8 inspector
      - "3000:3000"
      - "5858:5858"
    networks:
      - front-tier
      - back-tier

  redis:
    image: redis:3.2.6-alpine
    container_name: redis
    ports:
      - "6379:6379"
    restart: always
    volumes:
      - redis:/data
    networks:
      - back-tier

  mongodata:  
    image: mongo:3.4
    volumes:
      - /data/db
    command: --break-mongo
    networks:
      - back-tier

  mongo:  
    image: mongo:3.4
    volumes:
      - mongodata:/data/db
    ports:
      - "27017:27017"
    command: --smallfiles --rest
    networks:
      - back-tier

networks:
  front-tier:
  back-tier:

volumes:
  app:
  redis:
  mongodata:
version: "3"

services:
  app:
    container_name: nap_app
    env_file:
      - ./app/.env
    environment:
      - HTTP_PORT=${HTTP_PORT:-3000}
    build: ./app
    restart: always
    links:
      - redis
    command: npm start
    working_dir: /usr/app
    volumes:
      - app:/app
    ports:
      - "127.0.0.1:9229:9229" # V8 inspector
      - "3000:3000"
      - "5858:5858"
    networks:
      - front-tier
      - back-tier

  redis:
    image: redis:3.2.6-alpine
    container_name: redis
    ports:
      - "6379:6379"
    restart: always
    volumes:
      - redis:/data
    networks:
      - back-tier

  mongodata:  
    image: mongo:3.4
    volumes:
      - /data/db
    command: --break-mongo
    networks:
      - back-tier

  mongo:  
    image: mongo:3.4
    container_name: mongo
    volumes:
      - mongodata:/data/db
    ports:
      - "27017:27017"
    command: --smallfiles --rest
    networks:
      - back-tier

networks:
  front-tier:
  back-tier:

volumes:
  app:
  redis:
  mongodata:
Add default port to 3000
Add default port to 3000
