25'ten fazla konu seçemezsiniz Konular bir harf veya rakamla başlamalı, kısa çizgiler ('-') içerebilir ve en fazla 35 karakter uzunluğunda olabilir.
 
 
 
 

136 satır
3.4 KiB

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