docker-compose.yml 1.4 KB

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