networks:
  nw-letto:
    external: true

services:

  # image-service
  image:
    image: lettohub/letto-service-image:stable
    restart: always
    networks:
      - nw-letto
    deploy:
      resources:
        limits:
          memory: "${IMAGE_MEMORY_LIMIT:-1G}"
    logging:
      driver: "json-file"
      options:
        max-size: "2m"
        max-file: "3"
    hostname: letto-image
    container_name: letto-image
    volumes:
      - ${VOLUME_LOG:-/opt/letto/docker/storage/log}/image:/log
    environment:
      - TZ=${TIMEZONE:-Europe/Berlin}
      - LC_ALL=${LOCALE:-de_DE.UTF-8}
      - letto_schulen=${LETTO_SCHULEN}
      - UNHEALTHY_RETRIES=${IMAGE_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_IMAGE:--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=${QUESTION_MONGO_DEFAULT_DATABASE:-question}
      - debug=${DEBUG_IMAGE:-${DEBUG:-false}}
    ports:
      - "${DEBUG_PORT_IMAGE:-5091}:5091"
