docker-compose.yaml 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  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=redis://redis
  20. healthcheck:
  21. test: ["CMD", "curl", "-f", "http://localhost:3000/api/status"]
  22. interval: 5s
  23. timeout: 5s
  24. retries: 10
  25. pgsql:
  26. image: "postgres:latest"
  27. restart: unless-stopped
  28. container_name: postgres
  29. volumes:
  30. - ./pgsql:/var/lib/postgresql/data
  31. environment:
  32. TZ: Asia/Shanghai
  33. POSTGRES_USER: postgres
  34. POSTGRES_DB: aiproxy
  35. POSTGRES_PASSWORD: aiproxy
  36. healthcheck:
  37. test: ["CMD", "pg_isready", "-U", "postgres", "-d", "aiproxy"]
  38. interval: 5s
  39. timeout: 5s
  40. retries: 10
  41. redis:
  42. image: "redis:latest"
  43. container_name: redis
  44. restart: unless-stopped
  45. volumes:
  46. - ./redis:/data
  47. healthcheck:
  48. test: ["CMD", "redis-cli", "ping"]
  49. interval: 5s
  50. timeout: 5s
  51. retries: 10