Skip to content

Commit

Permalink
Add docker compose config
Browse files Browse the repository at this point in the history
  • Loading branch information
laurigates committed Sep 26, 2023
1 parent add4bdf commit 057daed
Showing 1 changed file with 56 additions and 0 deletions.
56 changes: 56 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
# mittaridatapumppu-endpoint

version: '3.8'

services:
endpoint-digita:
image: ghcr.io/city-of-helsinki/mittaridatapumppu-endpoint
build: .
ports:
- "8000:8000"
depends_on:
kafka:
condition: service_healthy
environment:
# Endpoint config
ALLOWED_IP_ADDRESSES: "127.0.0.1"
AUTH_TOKEN: "abcd1234"
DATA_SOURCE_NAME: "digita.thingpark.http"
ENDPOINT_PATH: "/digita/v2"
HTTP_REQUESTHANDLER: "endpoints.digita.aiothingpark"
# Kafka client config
KAFKA_HOST: "kafka"
KAFKA_PORT: 9092
KAFKA_BOOTSTRAP_SERVERS: "kafka:9092"
KAFKA_GROUP_ID: "digita_dev"
KAFKA_PARSED_DATA_TOPIC_NAME: "digita.parseddata"
KAFKA_RAW_DATA_TOPIC_NAME: "digita.rawdata"
# Debug config
LOG_LEVEL: "DEBUG"
DEBUG: 1
kafka:
image: bitnami/kafka:3.4
ports:
- "9092:9092"
volumes:
- "kafka_data:/bitnami"
environment:
KAFKA_CFG_AUTO_CREATE_TOPICS_ENABLE: "true"
# Kafka KRaft settings
KAFKA_CFG_NODE_ID: 0
KAFKA_CFG_PROCESS_ROLES: "controller,broker"
KAFKA_CFG_CONTROLLER_QUORUM_VOTERS: "0@kafka:9093"
# Listeners
KAFKA_CFG_LISTENERS: "PLAINTEXT://:9092,CONTROLLER://:9093"
KAFKA_CFG_ADVERTISED_LISTENERS: "PLAINTEXT://:9092"
KAFKA_CFG_LISTENER_SECURITY_PROTOCOL_MAP: "CONTROLLER:PLAINTEXT,PLAINTEXT:PLAINTEXT"
KAFKA_CFG_CONTROLLER_LISTENER_NAMES: "CONTROLLER"
KAFKA_CFG_INTER_BROKER_LISTENER_NAME: "PLAINTEXT"
healthcheck:
interval: 10s
retries: 3
test: kafka-topics.sh --bootstrap-server kafka:9092 --topic hc --create --if-not-exists && kafka-topics.sh --bootstrap-server kafka:9092 --topic hc --describe
timeout: 5s

volumes:
kafka_data:

0 comments on commit 057daed

Please sign in to comment.