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-app

services:
  # app-service: Neue Schüler-Version für WEB und Android/IOS
  app:
    image: lettohub/letto-service-app:stable
    restart: always
    networks:
      - nw-letto
    deploy:
      resources:
        limits:
          memory: "${APP_MEMORY_LIMIT:-1G}"
    logging:
      driver: "json-file"
      options:
        max-size: "2m"
        max-file: "3"
    hostname: letto-app
    container_name: letto-app
    volumes:
      - ${VOLUME_PUBLIC:-/opt/letto/docker/public}:/opt/letto/public
      - ${VOLUME_LOG:-/opt/letto/docker/storage/log}/app:/log
    environment:
      - LC_ALL=${LOCALE:-de_DE.UTF-8}
      - jwt_secret=${JWT_SECRET:-YWJj}
      - server_secret=${SERVER_SECRET:-YWJj}
      - UNHEALTHY_RETRIES=${APP_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_edit_uri=${LETTO_EDIT_URI:-http://letto-edit.nw-letto:8103}
      - letto_servername=${SERVER_NAME}
      - servername=${SERVER_NAME}
      - 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}
      - APP_SERVER_LIST=${APP_SERVER_LIST:-}
      - APP_PRIVATE_URI=${APP_PRIVATE_URI:-}
      - APP_QUESTION_SERVICES=${APP_QUESTION_SERVICES:-}

      - JAVA_OPTS=${JAVA_OPTS_APP:--Xms50m -Xmx300m}
      - debug=${DEBUG_APP:-${DEBUG:-false}}
    ports:
     # - "8199:8199"
      - "${DEBUG_PORT_APP:-5199}:5199"
