docker-compose.yaml 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. version: '3.3'
  2. services:
  3. aiproxy:
  4. image: 'ghcr.io/labring/aiproxy:latest'
  5. container_name: aiproxy
  6. restart: unless-stopped
  7. depends_on:
  8. pgsql:
  9. condition: service_healthy
  10. redis:
  11. condition: service_healthy
  12. ports:
  13. - '3000:3000/tcp'
  14. environment:
  15. - ADMIN_KEY=aiproxy
  16. - LOG_DETAIL_STORAGE_HOURS=1
  17. - TZ=Asia/Shanghai
  18. - SQL_DSN=postgres://postgres:aiproxy@pgsql:5432/aiproxy
  19. - REDIS_CONN_STRING=redis://redis
  20. - DISABLE_MODEL_CONFIG=true
  21. healthcheck:
  22. test: ["CMD", "curl", "-f", "http://localhost:3000/api/status"]
  23. interval: 5s
  24. timeout: 5s
  25. retries: 10
  26. pgsql:
  27. image: "postgres:latest"
  28. restart: unless-stopped
  29. container_name: postgres
  30. volumes:
  31. - ./pgsql:/var/lib/postgresql/data
  32. environment:
  33. TZ: Asia/Shanghai
  34. POSTGRES_USER: postgres
  35. POSTGRES_DB: aiproxy
  36. POSTGRES_PASSWORD: aiproxy
  37. healthcheck:
  38. test: ["CMD", "pg_isready", "-U", "postgres", "-d", "aiproxy"]
  39. interval: 5s
  40. timeout: 5s
  41. retries: 10
  42. redis:
  43. image: "redis:latest"
  44. container_name: redis
  45. restart: unless-stopped
  46. volumes:
  47. - ./redis:/data
  48. healthcheck:
  49. test: ["CMD", "redis-cli", "ping"]
  50. interval: 5s
  51. timeout: 5s
  52. retries: 10