docker-compose.yml 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. services:
  2. postgres:
  3. image: postgres:16-alpine
  4. environment:
  5. POSTGRES_DB: polybot
  6. POSTGRES_USER: polybot
  7. POSTGRES_PASSWORD: ${DB_PASSWORD:-botpass}
  8. volumes:
  9. - pgdata:/var/lib/postgresql/data
  10. ports:
  11. - '5432:5432'
  12. healthcheck:
  13. test: ['CMD-SHELL', 'pg_isready -U polybot -d polybot']
  14. interval: 10s
  15. timeout: 5s
  16. retries: 5
  17. redis:
  18. image: redis:7-alpine
  19. ports:
  20. - '6379:6379'
  21. volumes:
  22. - redisdata:/data
  23. healthcheck:
  24. test: ['CMD', 'redis-cli', 'ping']
  25. interval: 10s
  26. timeout: 5s
  27. retries: 5
  28. bot:
  29. build:
  30. context: .
  31. target: bot
  32. env_file: .env
  33. environment:
  34. DATABASE_URL: postgresql://polybot:${DB_PASSWORD:-botpass}@postgres:5432/polybot
  35. REDIS_URL: redis://redis:6379
  36. ports:
  37. - '${BOT_HEALTH_PORT:-3001}:3001'
  38. depends_on:
  39. postgres:
  40. condition: service_healthy
  41. redis:
  42. condition: service_healthy
  43. restart: unless-stopped
  44. dashboard:
  45. build:
  46. context: .
  47. target: dashboard
  48. env_file: .env
  49. environment:
  50. DATABASE_URL: postgresql://polybot:${DB_PASSWORD:-botpass}@postgres:5432/polybot
  51. REDIS_URL: redis://redis:6379
  52. BOT_HEALTH_URL: http://bot:3001
  53. ports:
  54. - '${DASHBOARD_PORT:-3000}:3000'
  55. depends_on:
  56. postgres:
  57. condition: service_healthy
  58. bot:
  59. condition: service_started
  60. restart: unless-stopped
  61. volumes:
  62. pgdata:
  63. redisdata: