networks:
  nw-letto:
    external: true

# Der Name bestimmt das Projekt und sollte bei jeder yml-Datei unterschiedlich sein - er kann mit -p bei docker-compose überschrieben werden
name: letto-lti

services:
  # lti-Service als Verbindung zu Moodle Server
  lti:
    image: lettohub/letto-service-lti:stable
    restart: always
    networks:
      - nw-letto
    hostname: letto-lti
    container_name: letto-lti
    deploy:
      resources:
        limits:
          memory: "${LTI_MEMORY_LIMIT:-1G}"
    logging:
      driver: "json-file"
      options:
        max-size: "2m"
        max-file: "3"
    volumes:
      - ${VOLUME_LOG:-/opt/letto/docker/storage/log}/lti:/log
    environment:
      - TZ=${TIMEZONE:-Europe/Berlin}
      - LC_ALL=${LOCALE:-de_DE.UTF-8}
      - spring_datasource_url=jdbc:mysql://${MYSQL_LTI_HOST:-letto-mysql.nw-letto:3306}/${MYSQL_LTI_DATABASE:-lettolti}?${MYSQL_LTI_PARS:-useSSL=false}
      - spring_datasource_username=${MYSQL_LTI_USER:-lettolti}
      - spring_datasource_password=${MYSQL_LTI_PASSWORD}
      - UNHEALTHY_RETRIES=${LTI_UNHEALTHY_RETRIES:-${UNHEALTHY_RETRIES:-20}}
      - letto_setup_uri=${LETTO_SETUP_URI:-http://letto-setup.nw-letto:8096}
      - letto_login_uri=${LETTO_LOGIN_URI:-http://letto-login.nw-letto:8095}
      - letto_schulen=${LETTO_SCHULEN}
      - jwt_secret=${JWT_SECRET:-YWJj}
      - server_secret=${SERVER_SECRET:-YWJj}
      - letto_local_privatkey=${LETTO_LOCAL_PRIVATE_KEY:-}
      - letto_local_publickey=${LETTO_LOCAL_PUBLIC_KEY:-}
      - 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_LTI:--Xms50m -Xmx100m}
      - 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=${LOGIN_MONGO_DEFAULT_DATABASE:-login}
      - debug=${DEBUG_LTI:-${DEBUG:-false}}
    ports:
    #  - "8090:8090"
      - "${DEBUG_PORT_LTI:-5090}:5090"
