networks:
  nw-letto:
    external: true

services:
  # MONGO-Datenbank als Dokumentorientierter persistenter Langzeit-Cache
  mongo:
    image: lettohub/letto-mongo:stable
    restart: always
    hostname: letto-mongo
    container_name: letto-mongo
    networks:
      - nw-letto
    deploy:
      resources:
        limits:
          memory: "${MONGO_MEMORY_LIMIT:-1G}"
    ports:
      - "127.0.0.1:27017:27017"
    environment:
      - MONGO_INITDB_ROOT_USERNAME=root
      - MONGO_INITDB_ROOT_PASSWORD=${MONGO_ROOT_PASSWORD:-${MYSQL_ROOT_PASSWORD}}
    volumes:
      - ${DOCKER_BASE:-/opt/letto/docker}/storage/mongo/data:/data/db
      - ${VOLUME_LOG:-/opt/letto/docker/storage/log}/mongo:/var/log/mongodb
      - ${DOCKER_BASE:-/opt/letto/docker}/storage/database-dump:/dump
