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-plugin-uhr

services:
  pluginuhr:
    image: lettohub/letto-service-pluginuhr:stable
    restart: always
    networks:
      - nw-letto
    hostname: letto-pluginuhr
    container_name: letto-pluginuhr
    deploy:
      resources:
        limits:
          memory: "${PLUGINUHR_MEMORY_LIMIT:-1G}"
    logging:
      driver: "json-file"
      options:
        max-size: "2m"
        max-file: "3"
    volumes:
      - ${VOLUME_LOG:-/opt/letto/docker/storage/log}/pluginuhr:/log
      - ${VOLUME_IMAGES:-/opt/letto/docker/storage/images}:/opt/letto/images
      - ${VOLUME_PLUGINS:-/opt/letto/docker/storage/plugins}:/opt/letto/plugins
    environment:
      - TZ=${TIMEZONE:-Europe/Berlin}
      - LC_ALL=${LOCALE:-de_DE.UTF-8}
      - letto_schulen=${LETTO_SCHULEN}
      - jwt_secret=${JWT_SECRET:-YWJj}
      - server_secret=${SERVER_SECRET:-YWJj}
      - UNHEALTHY_RETRIES=${PLUGIN_UNHEALTHY_RETRIES:-${UNHEALTHY_RETRIES:-20}}
      - 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_PLUGINUHR:--Xms50m -Xmx500m}
      - servername=${SERVER_NAME}
      - letto_pathImages=/opt/letto/images
      - letto_pathPlugins=/opt/letto/plugins
      - letto_webPathImages=${SERVER_NAME}/images
      - letto_webPathPlugins=${SERVER_NAME}/images/plugins

      - service_uri_projekte=${SERVICE_URI_PROJEKTE:-https://${SERVER_NAME:-localhost}}/${PROJEKTE_ENDPOINT:-projekte}
      - debug=${DEBUG_PLUGINS:-${DEBUG:-false}}
      - spring.mail.host=${spring_mail_host:-}
      - spring.mail.port=${spring_mail_port:-}
      - spring.mail.username=${spring_mail_username:-}
      - spring.mail.password=${spring_mail_password:-}
      - spring.mail.smtp.auth=${spring_mail_properties_mail_smtp_auth:-true}
      - spring.mail.properties.mail.smtp.starttls.enable=${spring_mail_properties_mail_smtp_starttls_enable:-true}
      - spring.mail.properties.mail.smtp.ssl.enable=${spring_mail_properties_mail_smtp_ssl_enable:-true}
      - spring.mail.properties.mail.debug=${spring_mail_properties_mail_debug:-false}
      - spring.mail.address.noreply=${spring_mail_address_noreply:-norelpy@schule.com}
      - spring.mail.address.reply=${spring_mail_address_reply:-relpy@schule.com}
      - 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}
      - letto.plugin.uri.intern=${LETTO_PLUGINUHR_URI_INTERN:-}
      - letto.plugin.uri.extern=${LETTO_PLUGINUHR_URI_EXTERN:-}
    ports:
      - "${DEBUG_PORT_PLUGIN_UHR:-5205}:5080"
    #  - "2134:8080"
