version: '3.8'

services:
    ligier:
        image: "docker.km3net.de/jpp:v14.4.3"
        container_name: monitoring-ligier-1
        deploy:
          resources:
           limits:
             memory: 1024M
        command: JLigier -d2
        volumes:
            - ./logs:/logs
        ports:
            - ${MONITORING_LIGIER_PORT}:5553

    ligiermirror:
        image: "docker.km3net.de/jpp:v14.4.3"
        deploy:
          resources:
           limits:
             memory: 512M
        env_file:
            - .env
        command: JLigierMirror -H ${DAQ_LIGIER_IP}:${DAQ_LIGIER_PORT} -X monitoring-ligier-1:5553 -t "${TAGS_TO_MIRROR}"
        volumes:
            - ./logs:/logs
        depends_on:
            - "ligier"
        restart: unless-stopped

    ligierlogmirror:
        image: "docker.km3net.de/jpp:v14.4.3"
        deploy:
          resources:
           limits:
             memory: 512M
        env_file:
            - .env
        command: JLigierMirror -H ${LOG_LIGIER_IP}:${LOG_LIGIER_PORT} -X monitoring-ligier-1:5553 -t "MSG Born Died"
        volumes:
            - ./logs:/logs
        depends_on:
            - "ligier"
        restart: unless-stopped

    ligiertmchmirror:
        image: "docker.km3net.de/jpp:v14.4.3"
        deploy:
          resources:
           limits:
             memory: 512M
        env_file:
            - .env
        command: JLigierMirror -H ${TMCH_LIGIER_IP}:${TMCH_LIGIER_PORT} -X monitoring-ligier-1:5553 -t IO_MONIT
        volumes:
            - ./logs:/logs
        depends_on:
            - "ligier"
        restart: unless-stopped

    backend:
        # build: ./backend
        image: "docker.km3net.de/km3mon-backend:${KM3MON_VERSION}"
        deploy:
          resources:
           limits:
             memory: 8192M
        env_file:
            - .env
        volumes:
            - ./backend:/monitoring
            - ./logs:/logs
            - ./plots:/plots
            - ./data:/data
        depends_on:
            - "ligier"

    frontend:
        # build: ./frontend
        image: "docker.km3net.de/km3mon-frontend:${KM3MON_VERSION}"
        deploy:
          resources:
           limits:
             memory: 1024M
        env_file:
            - .env
        ports:
            - ${WEBSERVER_PORT}:5000
        volumes:
            - ./frontend:/frontend
            - ./logs:/logs
            - ./plots:/plots
            - ./data:/data

    livelog:
        # build: ./livelog
        image: "docker.km3net.de/km3mon-livelog:${KM3MON_VERSION}"
        deploy:
          resources:
           limits:
            memory: 1024M
        ports:
            - ${LOGGING_PORT}:9001
        volumes:
            - ./logs:/logs
        restart: unless-stopped

    fibonaccifit:
        image: "git.km3net.de:4567/km3py/km3mon/fibonaccifit:latest"
        deploy:
          resources:
           limits:
             memory: 4096M
        env_file:
            - .env
        command: monitoring-ligier-1 ${MONITORING_LIGIER_PORT}
        volumes:
            - ./logs:/logs
            - ./plots:/plots
            - ./data:/data
            - ./fibonaccifit:/reco/src
        restart: unless-stopped
