Skip to content

Make Kafka service accessible both inside and outside container #475

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 10 additions & 4 deletions local/full/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,18 +29,24 @@ services:
file: ../docker-compose.yml
service: queue
zookeeper:
image: confluent/zookeeper
image: wurstmeister/zookeeper
ports:
- "2181:2181"
environment:
zk_id: "1"
kafka:
image: confluent/kafka
image: wurstmeister/kafka
container_name: tc-projects-kafka
depends_on:
- zookeeper
ports:
- "9092:9092"
environment:
KAFKA_ADVERTISED_LISTENERS: INSIDE://kafka:9093,OUTSIDE://localhost:9092
KAFKA_LISTENERS: INSIDE://kafka:9093,OUTSIDE://0.0.0.0:9092
KAFKA_LISTENER_SECURITY_PROTOCOL_MAP: INSIDE:PLAINTEXT,OUTSIDE:PLAINTEXT
KAFKA_INTER_BROKER_LISTENER_NAME: INSIDE
KAFKA_ZOOKEEPER_CONNECT: zookeeper:2181
kafka-client:
build: ./kafka-client
depends_on:
Expand All @@ -63,7 +69,7 @@ services:
- kafka-client
environment:
- PORT=3000
- KAFKA_URL=kafka:9092
- KAFKA_URL=kafka:9093
- JWT_TOKEN_SECRET=secret
- VALID_ISSUERS="[\"https://topcoder-newauth.auth0.com/\",\"https://api.topcoder-dev.com\"]"
project-processor-es:
Expand All @@ -82,7 +88,7 @@ services:
- kafka-client
environment:
- PORT=5000
- KAFKA_URL=kafka:9092
- KAFKA_URL=kafka:9093
- ES_HOST=esearch:9200
tc-notifications-reset-db:
extends:
Expand Down
2 changes: 1 addition & 1 deletion local/full/kafka-client/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
From confluent/kafka
From wurstmeister/kafka
WORKDIR /app/
COPY topics.txt .
COPY create-topics.sh .
Expand Down
2 changes: 1 addition & 1 deletion local/full/kafka-client/create-topics.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/bin/bash

while read topic; do
/usr/bin/kafka-topics --create --zookeeper zookeeper:2181 --partitions 1 --replication-factor 1 --topic $topic
/opt/kafka/bin/kafka-topics.sh --create --zookeeper zookeeper:2181 --partitions 1 --replication-factor 1 --topic $topic
done < topics.txt
Empty file modified local/kafka/kafka-client/create-topics.sh
100644 → 100755
Empty file.