version: "3"

networks:
  localnet: {}

services:

  cache:
    image: redis
    volumes:
      - ./redis/cache:/data
    networks:
      - localnet

  data:
    image: redis
    volumes:
      - ./redis/data:/data
    networks:
      - localnet

  server:
    build: .
    command: nodemon --ignore client server.js
    environment:
      - CACHE_URL=redis://cache:6379
      - DATA_URL=redis://data:6379
    env_file: .env
    volumes:
      - .:/app
    depends_on:
      - cache
      - data
    networks:
      - localnet
    ports:
      - "8080:5000"

  worker:
    build: .
    command: nodemon --ignore client server/ingestLogs.js
    environment:
      - DATA_URL=redis://data:6379
    env_file: .env
    volumes:
      - .:/app
    depends_on:
      - data
    networks:
      - localnet