docker-compose.yaml 1.3 KB

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