networks:
  nw-letto:
    external: true

services:
  # export-Service für Export,Import von XML-Files und Druck
  export:
    image: lettohub/letto-service-export:stable
    restart: always
    networks:
      - nw-letto
    hostname: letto-export
    container_name: letto-export
    deploy:
      resources:
        limits:
          memory: "${EXPORT_MEMORY_LIMIT:-1G}"
    logging:
      driver: "json-file"
      options:
        max-size: "2m"
        max-file: "3"
    volumes:
      - ${VOLUME_LOG:-/opt/letto/docker/storage/log}/export:/log
      - ${VOLUME_EXPORT:-/opt/letto/docker/storage/export}:/opt/letto/docker/storage/export
      - ${VOLUME_IMAGES:-/opt/letto/docker/storage/images}:/opt/letto/docker/storage/images
      - ${VOLUME_PLUGINS:-/opt/letto/docker/storage/plugins}:/opt/letto/docker/storage/plugins
      - ${VOLUME_PROJEKTE:-/opt/letto/docker/storage/projekte}:/opt/letto/docker/storage/projekte
      - ${VOLUME_PHOTOS:-/opt/letto/docker/storage/photos}:/opt/letto/docker/storage/photos
    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}
      - 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_EXPORT:--Xms50m -Xmx500m}
      - servername=${SERVER_NAME}
      - UNHEALTHY_RETRIES=${EXPORT_UNHEALTHY_RETRIES:-${UNHEALTHY_RETRIES:-20}}
      - service_uri_projekte=${SERVICE_URI_PROJEKTE:-https://${SERVER_NAME:-localhost}}/${PROJEKTE_ENDPOINT:-projekte}
      - debug=${DEBUG_EXPORT:-${DEBUG:-false}}
      - latex_halt_on_error=${LATEX_HALT_ON_ERROR:-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=${EXPORT_MONGO_DEFAULT_DATABASE:-export}
    ports:
      - "${DEBUG_PORT_EXPORT:-5099}:5099"
