networks:
  nw-letto:
    external: true

services:
  # REDIS-Datenbank als schneller Zwischenspeicher
  redis:
    image: lettohub/letto-redis:stable
    restart: always
    hostname: letto-redis
    container_name: letto-redis
    networks:
      - nw-letto
    deploy:
      resources:
        limits:
          memory: "${REDIS_MEMORY_LIMIT:-1G}"
    ports:
      - "127.0.0.1:6379:6379"
    volumes:
      - ${DOCKER_BASE:-/opt/letto/docker}/storage/redis/data:/data
      - ${VOLUME_LOG:-/opt/letto/docker/storage/log}/redis:/log
      - ${DOCKER_BASE:-/opt/letto/docker}/storage/database-dump:/dump
    environment:
      - REDIS_PASSWORD=${REDIS_PASSWORD:-${MYSQL_ROOT_PASSWORD}}
    command: [ "redis-server", "/redis.conf", "--requirepass", "${REDIS_PASSWORD:-${MYSQL_ROOT_PASSWORD}}" ]
