version: "3.8"
services:
  jupyterlab:
    image: registry.cern.ch/roxie/roxie-docker-env:latest
    ports:
      - "8888:8888"
    volumes:
      - ./data:/home/roxieenv/data
    depends_on:
      - mongo
    restart: always
  cache_rest:
    image: gitlab-registry.cern.ch/chart-magnum/pymbse-cache/pymbse-cache-rest-api:0.0.2
    command: bash -c "uvicorn main:app --host 0.0.0.0 --port 8000 --reload"
    expose:
      - 8000
    depends_on:
      - mongo
    restart: always
  mongo:
    # don't change as the name is used in pymbse-cache-rest-api container
    image: mongo
    environment:
      MONGO_INITDB_ROOT_USERNAME: mongo_user
      MONGO_INITDB_ROOT_PASSWORD: mongo_password
    expose:
      - 27017 # don't change as the port is used in pymbse-cache-rest-api container
    restart: always
  
  roxie:
    image: gitlab-registry.cern.ch/roxie/roxie-deployment/roxie_full:latest
    environment:
      - "MODEL_ROOT=/home/roxie/models"
      - "VNC_RESOLUTION=1920x1080"
    command: ["-v","-r"]
    expose:
      - 8080
    ports:
      - "5901:5901"
      - "6901:6901"
    volumes:
      - .:/home/roxie/data
    restart: always

  roxie_old:
    image: gitlab-registry.cern.ch/roxie/roxie-deployment/roxie_full:23.9.0.b18
    environment:
      - "MODEL_ROOT=/home/roxie/models"
      - "VNC_RESOLUTION=1920x1080"
      - "ROXIE_API_PORT=8081"
    command: ["-v","-r"]
    expose:
      - 8081
    ports:
      - "5902:5901"
      - "6902:6901"
    volumes:
      - .:/home/roxie/data
    restart: always

#  ansys:
#    restart: always
#    shm_size: '8gb'
#    mem_reservation: 8g
#    environment:
#      - ANSYSLMD_LICENSE_FILE=1055@licenansys
#      - ANSYS_LOCK=OFF
#      - AWP_ROOT222=/ansys_inc
#    ports:
#      - '50052:50052'
#      - '50055:50055'
#    image: gitlab-registry.cern.ch/chart-magnum/ansys-docker/ansys-mapl:v222
#    user: "0:0"
#    entrypoint: "/bin/bash ansys -grpc"
