docker-compose.yml 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990
  1. services:
  2. postgres:
  3. image: postgres:16-alpine
  4. container_name: hr-lab-postgres
  5. environment:
  6. POSTGRES_DB: hr_lab
  7. POSTGRES_USER: hr_app
  8. POSTGRES_PASSWORD: hr_app_password
  9. ports:
  10. - "5432:5432"
  11. volumes:
  12. - postgres-data:/var/lib/postgresql/data
  13. - ../storage/backups:/backups
  14. healthcheck:
  15. test: ["CMD-SHELL", "pg_isready -U hr_app -d hr_lab"]
  16. interval: 10s
  17. timeout: 5s
  18. retries: 10
  19. redis:
  20. image: redis:7-alpine
  21. container_name: hr-lab-redis
  22. ports:
  23. - "6379:6379"
  24. healthcheck:
  25. test: ["CMD", "redis-cli", "ping"]
  26. interval: 10s
  27. timeout: 5s
  28. retries: 10
  29. rabbitmq:
  30. image: rabbitmq:3.13-management-alpine
  31. container_name: hr-lab-rabbitmq
  32. environment:
  33. RABBITMQ_DEFAULT_USER: hr_app
  34. RABBITMQ_DEFAULT_PASS: hr_app_password
  35. ports:
  36. - "5672:5672"
  37. - "15672:15672"
  38. healthcheck:
  39. test: ["CMD", "rabbitmq-diagnostics", "ping"]
  40. interval: 10s
  41. timeout: 5s
  42. retries: 10
  43. backend:
  44. build:
  45. context: ..
  46. dockerfile: deploy/backend.Dockerfile
  47. container_name: hr-lab-backend
  48. environment:
  49. SPRING_PROFILES_ACTIVE: lab
  50. DB_URL: jdbc:postgresql://postgres:5432/hr_lab
  51. DB_USERNAME: hr_app
  52. DB_PASSWORD: hr_app_password
  53. REDIS_HOST: redis
  54. RABBITMQ_HOST: rabbitmq
  55. RABBITMQ_USERNAME: hr_app
  56. RABBITMQ_PASSWORD: hr_app_password
  57. JWT_SECRET: local-development-secret-please-change-32bytes
  58. TASKS_INLINE: "true"
  59. LAB_EMPLOYEE_COUNT: "2000"
  60. LAB_CANDIDATE_COUNT: "500"
  61. LAB_ATTENDANCE_DAYS: "180"
  62. EXPORT_DIR: /app/storage/exports
  63. IMPORT_DIR: /app/storage/imports
  64. ports:
  65. - "8080:8080"
  66. volumes:
  67. - ../storage:/app/storage
  68. depends_on:
  69. postgres:
  70. condition: service_healthy
  71. redis:
  72. condition: service_healthy
  73. rabbitmq:
  74. condition: service_healthy
  75. frontend:
  76. build:
  77. context: ..
  78. dockerfile: deploy/frontend.Dockerfile
  79. container_name: hr-lab-frontend
  80. ports:
  81. - "5173:80"
  82. depends_on:
  83. - backend
  84. volumes:
  85. postgres-data: