services:
  redis:
    image: redis:7.4.1
    restart: always
    container_name: ${CONTAINER_NAME}
    networks:
      - icontainer-network
    ports:
      - ${PANEL_APP_PORT_HTTP}:6379
    command: >
      sh -c '
      if [ -z "${PANEL_REDIS_ROOT_PASSWORD}" ]; then
        redis-server /etc/redis/redis.conf
      else
        redis-server /etc/redis/redis.conf --requirepass ${PANEL_REDIS_ROOT_PASSWORD}
      fi'
    volumes:
      - ./data:/data
      - ./conf/redis.conf:/etc/redis/redis.conf
      - ./logs:/logs
    labels:
      createdBy: "icontainer"
networks:
  icontainer-network:
    external: true