docker-compose.yml 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. services:
  2. lqRedis:
  3. image: redis:latest
  4. container_name: lqRedis # 固定名称
  5. restart: always
  6. volumes:
  7. - /home/app/docker_mapping/redis/data:/data:rw
  8. - /home/app/docker_mapping/redis/conf/redis.conf:/usr/local/etc/redis/redis.conf
  9. ports:
  10. - "0.0.0.0:16379:6379"
  11. command: redis-server --requirepass lq@123 # 👈 关键!设置密码
  12. networks:
  13. - lq_network
  14. healthcheck:
  15. test: ["CMD", "redis-cli", "-a", "onlinejudge", "ping"] # 👈 健康检查也要带密码
  16. interval: 5s
  17. timeout: 5s
  18. retries: 10
  19. start_period: 5s
  20. LQAgentServer:
  21. image: lq_agent_platform_server:v0.1
  22. container_name: LQAgentServer
  23. restart: always
  24. depends_on:
  25. lqRedis:
  26. condition: service_healthy # 👈 等待 Redis 健康
  27. volumes:
  28. - /home/app/lq_workspace/app/LqAgentServer/config:/app/config/:rw
  29. - /home/app/lq_workspace/app/LqAgentServer/logs:/app/logs
  30. environment:
  31. - TZ=Asia/Shanghai # 设置时区为上海(北京时间)
  32. ports:
  33. - "0.0.0.0:18001:8001"
  34. networks:
  35. - lq_network
  36. networks:
  37. lq_network:
  38. driver: bridge