diff --git a/deploy/prometheus.yml b/deploy/prometheus.yml index 0d296d7..56d26b2 100644 --- a/deploy/prometheus.yml +++ b/deploy/prometheus.yml @@ -34,6 +34,6 @@ scrape_configs: - job_name: 'machine' scrape_interval: 2s static_configs: - - targets: ['host.docker.internal:9100'] + - targets: ['node_exporter:9100'] labels: group: 'backend' \ No newline at end of file diff --git a/docker-compose.yaml b/docker-compose.yaml index cfbd7ea..0262ab0 100644 --- a/docker-compose.yaml +++ b/docker-compose.yaml @@ -56,15 +56,20 @@ services: node_exporter: image: quay.io/prometheus/node-exporter:latest + pid: host command: - - '--path.rootfs=/host' - ports: - - 9100:9100 + - '--path.procfs=/host/proc' + - '--path.rootfs=/rootfs' + - '--path.sysfs=/host/sys' + - '--collector.filesystem.mount-points-exclude=^/(sys|proc|dev|host|etc)($$|/)' + volumes: + - /proc:/host/proc:ro + - /sys:/host/sys:ro + - /:/rootfs:ro extra_hosts: - "host.docker.internal:host-gateway" - pid: host - volumes: - - '/:/host:ro,rslave' + ports: + - 9100:9100 otel-collector: image: otel/opentelemetry-collector-contrib:0.108.0 @@ -97,12 +102,17 @@ services: - tempo-init kafka: - image: apache/kafka:3.8.0 + image: &kafkaImage apache/kafka:3.8.0 + healthcheck: + test: ["CMD-SHELL", "/opt/kafka/bin/kafka-cluster.sh cluster-id --bootstrap-server http://127.0.0.1:9092 || exit 1"] + interval: 1s + timeout: 30s + retries: 30 environment: KAFKA_NODE_ID: 1 KAFKA_PROCESS_ROLES: broker,controller KAFKA_LISTENERS: PLAINTEXT://0.0.0.0:9092,CONTROLLER://0.0.0.0:9093 - KAFKA_ADVERTISED_LISTENERS: PLAINTEXT://localhost:9092 + KAFKA_ADVERTISED_LISTENERS: PLAINTEXT://kafka:9092 KAFKA_CONTROLLER_LISTENER_NAMES: CONTROLLER KAFKA_LISTENER_SECURITY_PROTOCOL_MAP: CONTROLLER:PLAINTEXT,PLAINTEXT:PLAINTEXT KAFKA_CONTROLLER_QUORUM_VOTERS: 1@localhost:9093 @@ -113,18 +123,48 @@ services: KAFKA_NUM_PARTITIONS: 3 ports: - 9092:9092 - # - 9093:9093 - # backend: - # build: . - # # dockerfile: ./dockerfile - # volumes: - # - ./:/app - # ports: - # - 8080:8080 + kafka-init: + image: *kafkaImage + depends_on: + kafka: + condition: service_healthy + entrypoint: > + /bin/bash -c "/opt/kafka/bin/kafka-topics.sh --bootstrap-server http://kafka:9092 --create --topic events --partitions 6" + + + minio: + image: quay.io/minio/minio:latest + command: ["server", "/data", "--console-address", ":9001"] + healthcheck: + test: 'mc ready local' + interval: 1s + environment: + MINIO_ROOT_USER: miniouser + MINIO_ROOT_PASSWORD: miniouser + MINIO_ACCESS_KEY: miniokey + MINIO_SECRET_KEY: miniokey + ports: + - 9000:9000 + - 9001:9001 + volumes: + - minio-volume:/data + + minio-init: + image: quay.io/minio/mc:latest + depends_on: + - minio + entrypoint: > + /bin/sh -c " + /usr/bin/mc alias set myminio http://minio:9000 miniouser miniouser; + /usr/bin/mc mb minio/bucket; + /usr/bin/mc anonymous set public minio/bucket; + exit 0; + " volumes: postgres-volume: grafana-volume: tempo-volume: - prometheus-volume: \ No newline at end of file + prometheus-volume: + minio-volume: \ No newline at end of file