|
- version: "2"
- services:
- db:
- image: postgres
- container_name: db
- restart: always
- ports:
- - "127.0.0.1:5432:5432"
- env_file:
- - ./env/db.env
- healthcheck:
- test: ["CMD-SHELL", "pg_isready -U postgres"]
- interval: 5s
- timeout: 5s
- retries: 5
- start_period: 30s
-
- kafdrop:
- image: obsidiandynamics/kafdrop
- restart: "no"
- ports:
- - "127.0.0.1:9000:9000"
- env_file:
- - ./env/kafdrop.env
- depends_on:
- - "kafka"
- kafka:
- image: apache/kafka:3.9.0
- restart: "no"
- ports:
- # - "127.0.0.1:2181:2181"
- - "127.0.0.1:9092:9092"
- - "127.0.0.1:9093:9093"
- env_file:
- - ./env/kafka.env
- healthcheck: # <-- ADD THIS BLOCK
- test: ["CMD-SHELL", "/opt/kafka/bin/kafka-topics.sh --bootstrap-server 127.0.0.1:9092 --list"]
- interval: 10s
- timeout: 5s
- retries: 10
- start_period: 20s
-
- kafka-init:
- image: apache/kafka:3.9.0
- command: [ "sh", "-c", "ls -l /tmp/create_topic.sh && /tmp/create_topic.sh" ]
- depends_on:
- kafka:
- condition: service_healthy
- volumes:
- - ./init-scripts/create_topic.sh:/tmp/create_topic.sh
- env_file:
- - ./env/kafka-init.env
-
- valkey:
- image: valkey/valkey:9.0.0
- container_name: valkey
- ports:
- - "127.0.0.1:6379:6379"
-
- presense-decoder:
- build:
- context: ../
- dockerfile: build/package/Dockerfile.dev
- image: presense-decoder
- container_name: presense-decoder
- env_file:
- - ./env/presense-decoder.env
- depends_on:
- kafka-init:
- condition: service_completed_successfully
- db:
- condition: service_healthy
- restart: always
- volumes:
- - ../:/app
- command: air --build.cmd "go build -buildvcs=false -o /tmp/decoder ./cmd/decoder" --build.bin "/tmp/decoder"
-
- presense-server:
- build:
- context: ../
- dockerfile: build/package/Dockerfile.dev
- image: presense-server
- container_name: presense-server
- env_file:
- - ./env/presense-server.env
- ports:
- - "127.0.0.1:1902:1902"
- depends_on:
- valkey:
- condition: service_started
- kafka-init:
- condition: service_completed_successfully
- db:
- condition: service_healthy
- restart: always
- volumes:
- - ../:/app
- command: air --build.cmd "go build -buildvcs=false -o /tmp/server ./cmd/server" --build.bin "/tmp/server"
-
- presense-bridge:
- build:
- context: ../
- dockerfile: build/package/Dockerfile.dev
- image: presense-bridge
- container_name: presense-bridge
- env_file:
- - ./env/presense-bridge.env
- depends_on:
- kafka-init:
- condition: service_completed_successfully
- db:
- condition: service_healthy
- restart: always
- volumes:
- - ../:/app
- command: air --build.cmd "go build -buildvcs=false -o /tmp/bridge ./cmd/bridge" --build.bin "/tmp/bridge"
-
- presense-location:
- build:
- context: ../
- dockerfile: build/package/Dockerfile.dev
- image: presense-location
- container_name: presense-location
- env_file:
- - ./env/presense-location.env
- depends_on:
- kafka-init:
- condition: service_completed_successfully
- db:
- condition: service_healthy
- restart: always
- volumes:
- - ../:/app
- command: air --build.cmd "go build -buildvcs=false -o /tmp/location ./cmd/location" --build.bin "/tmp/location"
-
-
|