Вы не можете выбрать более 25 тем Темы должны начинаться с буквы или цифры, могут содержать дефисы(-) и должны содержать не более 35 символов.
 
 
 
 

138 строки
3.4 KiB

  1. version: "2"
  2. services:
  3. db:
  4. image: postgres
  5. container_name: db
  6. restart: always
  7. ports:
  8. - "127.0.0.1:5432:5432"
  9. env_file:
  10. - ./env/db.env
  11. healthcheck:
  12. test: ["CMD-SHELL", "pg_isready -U postgres"]
  13. interval: 5s
  14. timeout: 5s
  15. retries: 5
  16. start_period: 30s
  17. kafdrop:
  18. image: obsidiandynamics/kafdrop
  19. restart: "no"
  20. ports:
  21. - "127.0.0.1:9000:9000"
  22. env_file:
  23. - ./env/kafdrop.env
  24. depends_on:
  25. - "kafka"
  26. kafka:
  27. image: apache/kafka:3.9.0
  28. restart: "no"
  29. ports:
  30. # - "127.0.0.1:2181:2181"
  31. - "127.0.0.1:9092:9092"
  32. - "127.0.0.1:9093:9093"
  33. env_file:
  34. - ./env/kafka.env
  35. healthcheck: # <-- ADD THIS BLOCK
  36. test: ["CMD-SHELL", "/opt/kafka/bin/kafka-topics.sh --bootstrap-server 127.0.0.1:9092 --list"]
  37. interval: 10s
  38. timeout: 5s
  39. retries: 10
  40. start_period: 20s
  41. kafka-init:
  42. image: apache/kafka:3.9.0
  43. command: [ "sh", "-c", "ls -l /tmp/create_topic.sh && /tmp/create_topic.sh" ]
  44. depends_on:
  45. kafka:
  46. condition: service_healthy
  47. volumes:
  48. - ./init-scripts/create_topic.sh:/tmp/create_topic.sh
  49. env_file:
  50. - ./env/kafka-init.env
  51. valkey:
  52. image: valkey/valkey:9.0.0
  53. container_name: valkey
  54. ports:
  55. - "127.0.0.1:6379:6379"
  56. presense-decoder:
  57. build:
  58. context: ../
  59. dockerfile: build/package/Dockerfile.dev
  60. image: presense-decoder
  61. container_name: presense-decoder
  62. env_file:
  63. - ./env/presense-decoder.env
  64. depends_on:
  65. kafka-init:
  66. condition: service_completed_successfully
  67. db:
  68. condition: service_healthy
  69. restart: always
  70. volumes:
  71. - ../:/app
  72. command: air --build.cmd "go build -buildvcs=false -o /tmp/decoder ./cmd/decoder" --build.bin "/tmp/decoder"
  73. presense-server:
  74. build:
  75. context: ../
  76. dockerfile: build/package/Dockerfile.dev
  77. image: presense-server
  78. container_name: presense-server
  79. env_file:
  80. - ./env/presense-server.env
  81. ports:
  82. - "127.0.0.1:1902:1902"
  83. depends_on:
  84. valkey:
  85. condition: service_started
  86. kafka-init:
  87. condition: service_completed_successfully
  88. db:
  89. condition: service_healthy
  90. restart: always
  91. volumes:
  92. - ../:/app
  93. command: air --build.cmd "go build -buildvcs=false -o /tmp/server ./cmd/server" --build.bin "/tmp/server"
  94. presense-bridge:
  95. build:
  96. context: ../
  97. dockerfile: build/package/Dockerfile.dev
  98. image: presense-bridge
  99. container_name: presense-bridge
  100. env_file:
  101. - ./env/presense-bridge.env
  102. depends_on:
  103. kafka-init:
  104. condition: service_completed_successfully
  105. db:
  106. condition: service_healthy
  107. restart: always
  108. volumes:
  109. - ../:/app
  110. command: air --build.cmd "go build -buildvcs=false -o /tmp/bridge ./cmd/bridge" --build.bin "/tmp/bridge"
  111. presense-location:
  112. build:
  113. context: ../
  114. dockerfile: build/package/Dockerfile.dev
  115. image: presense-location
  116. container_name: presense-location
  117. env_file:
  118. - ./env/presense-location.env
  119. depends_on:
  120. kafka-init:
  121. condition: service_completed_successfully
  122. db:
  123. condition: service_healthy
  124. restart: always
  125. volumes:
  126. - ../:/app
  127. command: air --build.cmd "go build -buildvcs=false -o /tmp/location ./cmd/location" --build.bin "/tmp/location"