services:

  lqRedis:
    image: redis:latest
    container_name: lqRedis  # 固定名称
    restart: always
    volumes:
      - /home/app/docker_mapping/redis/data:/data:rw
      - /home/app/docker_mapping/redis/conf/redis.conf:/usr/local/etc/redis/redis.conf
    ports:
      - "0.0.0.0:16379:6379"
    command: redis-server --requirepass lq@123  # 👈 关键！设置密码
    networks:
      - lq_network
    healthcheck:
      test: ["CMD", "redis-cli", "-a", "onlinejudge", "ping"]  # 👈 健康检查也要带密码
      interval: 5s
      timeout: 5s
      retries: 10
      start_period: 5s

  
  LQAgentServer:
    image: lq_agent_platform_server:v0.1
    container_name: LQAgentServer
    restart: always
    depends_on:
      lqRedis:
        condition: service_healthy # 👈 等待 Redis 健康
    
    volumes:
      - /home/app/lq_workspace/app/LqAgentServer/config:/app/config/:rw
      - /home/app/lq_workspace/app/LqAgentServer/logs:/app/logs
    environment:
      - TZ=Asia/Shanghai  # 设置时区为上海（北京时间）
    ports:
      - "0.0.0.0:18001:8001"
    networks:
      - lq_network
    


networks:
  lq_network:
    driver: bridge