Nelze vybrat více než 25 témat Téma musí začínat písmenem nebo číslem, může obsahovat pomlčky („-“) a může být dlouhé až 35 znaků.
 
 
 
 

142 řádky
3.5 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. valkey:
  56. image: valkey/valkey:9.0.0
  57. container_name: valkey
  58. ports:
  59. - "127.0.0.1:6379:6379"
  60. presense-decoder:
  61. build:
  62. context: ../
  63. dockerfile: build/package/Dockerfile.dev
  64. image: presense-decoder
  65. container_name: presense-decoder
  66. env_file:
  67. - ./env/presense-decoder.env
  68. depends_on:
  69. kafka-init:
  70. condition: service_completed_successfully
  71. db:
  72. condition: service_healthy
  73. restart: always
  74. volumes:
  75. - ../:/app
  76. command: air --build.cmd "go build -buildvcs=false -o ./decoder ./cmd/decoder" --build.bin "./decoder"
  77. presense-server:
  78. build:
  79. context: ../
  80. dockerfile: build/package/Dockerfile.dev
  81. image: presense-server
  82. container_name: presense-server
  83. env_file:
  84. - ./env/presense-server.env
  85. ports:
  86. - "127.0.0.1:1902:1902"
  87. depends_on:
  88. valkey:
  89. condition: service_started
  90. kafka-init:
  91. condition: service_completed_successfully
  92. db:
  93. condition: service_healthy
  94. restart: always
  95. volumes:
  96. - ../:/app
  97. command: air --build.cmd "go build -buildvcs=false -o ./server ./cmd/server" --build.bin "./server"
  98. presense-bridge:
  99. build:
  100. context: ../
  101. dockerfile: build/package/Dockerfile.dev
  102. image: presense-bridge
  103. container_name: presense-bridge
  104. env_file:
  105. - ./env/presense-bridge.env
  106. depends_on:
  107. kafka-init:
  108. condition: service_completed_successfully
  109. db:
  110. condition: service_healthy
  111. restart: always
  112. volumes:
  113. - ../:/app
  114. command: air --build.cmd "go build -buildvcs=false -o ./bridge ./cmd/bridge" --build.bin "./bridge"
  115. presense-location:
  116. build:
  117. context: ../
  118. dockerfile: build/package/Dockerfile.dev
  119. image: presense-location
  120. container_name: presense-location
  121. env_file:
  122. - ./env/presense-location.env
  123. depends_on:
  124. kafka-init:
  125. condition: service_completed_successfully
  126. db:
  127. condition: service_healthy
  128. restart: always
  129. volumes:
  130. - ../:/app
  131. command: air --build.cmd "go build -buildvcs=false -o ./location ./cmd/location" --build.bin "./location"
  132. volumes:
  133. pgdata:
  134. kafkadata: