Nevar pievienot vairāk kā 25 tēmas Tēmai ir jāsākas ar burtu vai ciparu, tā var saturēt domu zīmes ('-') un var būt līdz 35 simboliem gara.
 
 
 
 

162 rindas
3.9 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. environment:
  64. LOG_LEVEL: "info"
  65. depends_on:
  66. kafka-init:
  67. condition: service_completed_successfully
  68. db:
  69. condition: service_healthy
  70. restart: always
  71. logging:
  72. driver: "json-file"
  73. options:
  74. max-size: "10m"
  75. max-file: "3"
  76. volumes:
  77. - ../:/app
  78. command: air --build.cmd "go build -buildvcs=false -o ./decoder ./cmd/decoder" --build.bin "./decoder"
  79. presense-server:
  80. build:
  81. context: ../
  82. dockerfile: build/package/Dockerfile.dev
  83. image: presense-server
  84. container_name: presense-server
  85. env_file:
  86. - ./env/presense-server.env
  87. environment:
  88. LOG_LEVEL: "info"
  89. ports:
  90. - "127.0.0.1:1902:1902"
  91. depends_on:
  92. kafka-init:
  93. condition: service_completed_successfully
  94. db:
  95. condition: service_healthy
  96. restart: always
  97. logging:
  98. driver: "json-file"
  99. options:
  100. max-size: "10m"
  101. max-file: "3"
  102. volumes:
  103. - ../:/app
  104. command: air --build.cmd "go build -buildvcs=false -o ./server ./cmd/server" --build.bin "./server"
  105. presense-bridge:
  106. build:
  107. context: ../
  108. dockerfile: build/package/Dockerfile.dev
  109. image: presense-bridge
  110. container_name: presense-bridge
  111. env_file:
  112. - ./env/presense-bridge.env
  113. environment:
  114. LOG_LEVEL: "info"
  115. depends_on:
  116. kafka-init:
  117. condition: service_completed_successfully
  118. db:
  119. condition: service_healthy
  120. restart: always
  121. logging:
  122. driver: "json-file"
  123. options:
  124. max-size: "10m"
  125. max-file: "3"
  126. volumes:
  127. - ../:/app
  128. command: air --build.cmd "go build -buildvcs=false -o ./bridge ./cmd/bridge" --build.bin "./bridge"
  129. presense-location:
  130. build:
  131. context: ../
  132. dockerfile: build/package/Dockerfile.dev
  133. image: presense-location
  134. container_name: presense-location
  135. env_file:
  136. - ./env/presense-location.env
  137. environment:
  138. LOG_LEVEL: "info"
  139. depends_on:
  140. kafka-init:
  141. condition: service_completed_successfully
  142. db:
  143. condition: service_healthy
  144. restart: always
  145. logging:
  146. driver: "json-file"
  147. options:
  148. max-size: "10m"
  149. max-file: "3"
  150. volumes:
  151. - ../:/app
  152. command: air --build.cmd "go build -buildvcs=false -o ./location ./cmd/location" --build.bin "./location"
  153. volumes:
  154. pgdata:
  155. kafkadata: