networks:
  nw-letto:
    external: true

services:
  # Plugin-Sourcecode-Service-Service für die Korrektur von einfacher Software
  pluginsourcecode:
    image: lettohub/letto-service-plugin-sourcecode:stable
    restart: always
    networks:
      - nw-letto
    hostname: letto-pluginsourcecode
    container_name: letto-pluginsourcecode
    deploy:
      resources:
        limits:
          memory: "${PLUGINSOURCECODE_MEMORY_LIMIT:-1G}"
    logging:
      driver: "json-file"
      options:
        max-size: "2m"
        max-file: "3"
    volumes:
      - ${VOLUME_LOG:-/opt/letto/docker/storage/log}/pluginsourcecode:/log
    environment:
      - TZ=${TIMEZONE:-Europe/Berlin}
      - LC_ALL=${LOCALE:-de_DE.UTF-8}
      - letto_schulen=${LETTO_SCHULEN}
      - UNHEALTHY_RETRIES=${PLUGIN_UNHEALTHY_RETRIES:-${UNHEALTHY_RETRIES:-20}}
      - 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_PLUGINSOURCECODE:--Xms50m -Xmx300m}
      - 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_PLUGINSOURCECODE:-${DEBUG:-false}}
    ports:
      - "${DEBUG_PORT_PLUGINSOURCECODE:-5204}:5204"
