Skip to content

Commit 99308b0

Browse files
authored
Merge pull request #475 from xxcxy/develop
Make Kafka service accessible both inside and outside container
2 parents 254b635 + 9803b01 commit 99308b0

File tree

4 files changed

+12
-6
lines changed

4 files changed

+12
-6
lines changed

local/full/docker-compose.yml

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,18 +29,24 @@ services:
2929
file: ../docker-compose.yml
3030
service: queue
3131
zookeeper:
32-
image: confluent/zookeeper
32+
image: wurstmeister/zookeeper
3333
ports:
3434
- "2181:2181"
3535
environment:
3636
zk_id: "1"
3737
kafka:
38-
image: confluent/kafka
38+
image: wurstmeister/kafka
3939
container_name: tc-projects-kafka
4040
depends_on:
4141
- zookeeper
4242
ports:
4343
- "9092:9092"
44+
environment:
45+
KAFKA_ADVERTISED_LISTENERS: INSIDE://kafka:9093,OUTSIDE://localhost:9092
46+
KAFKA_LISTENERS: INSIDE://kafka:9093,OUTSIDE://0.0.0.0:9092
47+
KAFKA_LISTENER_SECURITY_PROTOCOL_MAP: INSIDE:PLAINTEXT,OUTSIDE:PLAINTEXT
48+
KAFKA_INTER_BROKER_LISTENER_NAME: INSIDE
49+
KAFKA_ZOOKEEPER_CONNECT: zookeeper:2181
4450
kafka-client:
4551
build: ./kafka-client
4652
depends_on:
@@ -63,7 +69,7 @@ services:
6369
- kafka-client
6470
environment:
6571
- PORT=3000
66-
- KAFKA_URL=kafka:9092
72+
- KAFKA_URL=kafka:9093
6773
- JWT_TOKEN_SECRET=secret
6874
- VALID_ISSUERS="[\"https://topcoder-newauth.auth0.com/\",\"https://api.topcoder-dev.com\"]"
6975
project-processor-es:
@@ -82,7 +88,7 @@ services:
8288
- kafka-client
8389
environment:
8490
- PORT=5000
85-
- KAFKA_URL=kafka:9092
91+
- KAFKA_URL=kafka:9093
8692
- ES_HOST=esearch:9200
8793
tc-notifications-reset-db:
8894
extends:

local/full/kafka-client/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
From confluent/kafka
1+
From wurstmeister/kafka
22
WORKDIR /app/
33
COPY topics.txt .
44
COPY create-topics.sh .
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#!/bin/bash
22

33
while read topic; do
4-
/usr/bin/kafka-topics --create --zookeeper zookeeper:2181 --partitions 1 --replication-factor 1 --topic $topic
4+
/opt/kafka/bin/kafka-topics.sh --create --zookeeper zookeeper:2181 --partitions 1 --replication-factor 1 --topic $topic
55
done < topics.txt

local/kafka/kafka-client/create-topics.sh

100644100755
File mode changed.

0 commit comments

Comments
 (0)