networks:
  nw-letto:
    external: true

services:
  # lti-Service als Verbindung zu Moodle Server
  plugin:
    image: lettohub/letto-service-plugin:stable
    restart: always
    networks:
      - nw-letto
    hostname: letto-plugin
    container_name: letto-plugin
    deploy:
      resources:
        limits:
          memory: "${PLUGIN_MEMORY_LIMIT:-1G}"
    logging:
      driver: "json-file"
      options:
        max-size: "2m"
        max-file: "3"
    volumes:
      - ${VOLUME_LOG:-/opt/letto/docker/storage/log}/plugin:/log
    environment:
      - TZ=${TIMEZONE:-Europe/Berlin}
      - LC_ALL=${LOCALE:-de_DE.UTF-8}
      - UNHEALTHY_RETRIES=${PLUGIN_UNHEALTHY_RETRIES:-${UNHEALTHY_RETRIES:-20}}
      - letto_schulen=${LETTO_SCHULEN}
      - letto_user_user_password=${SERVICE_USER_PASSWORD}
      - letto_user_gast_password=${SERVICE_GAST_PASSWORD}
      - letto_user_admin_password=${SERVICE_ADMIN_PASSWORD}
      - letto_setup_uri=${LETTO_SETUP_URI:-http://letto-setup.nw-letto:8096}
      - letto_login_uri=${LETTO_LOGIN_URI:-http://letto-login.nw-letto:8095}
      - JAVA_OPTS=${JAVA_OPTS_PLUGIN:--Xms50m -Xmx200m}
      - REDIS_PASSWORD=${REDIS_PASSWORD:-${MYSQL_ROOT_PASSWORD}}
      - REDIS_DEFAULT_DATABASE=${LOGIN_REDIS_DEFAULT_DATABASE:-1}
      - MONGO_ROOT_PASSWORD=${MONGO_ROOT_PASSWORD:-${MYSQL_ROOT_PASSWORD}}
      - MONGO_DEFAULT_DATABASE=${PLUGIN_MONGO_DEFAULT_DATABASE:-plugin}
      - debug=${DEBUG_PLUGIN:-${DEBUG:-false}}
    ports:
      - "${DEBUG_PORT_PLUGIN:-5200}:5200"
