simplified and improved the docker configuration
added a public run IDEA task to easily test the project
This commit is contained in:
parent
500cdbd95b
commit
90d64434a9
2 changed files with 33 additions and 45 deletions
13
.run/compose.run.xml
Normal file
13
.run/compose.run.xml
Normal file
|
@ -0,0 +1,13 @@
|
||||||
|
<component name="ProjectRunConfigurationManager">
|
||||||
|
<configuration default="false" name="compose" type="docker-deploy" factoryName="docker-compose.yml" server-name="Docker">
|
||||||
|
<deployment type="docker-compose.yml">
|
||||||
|
<settings>
|
||||||
|
<option name="envFilePath" value="" />
|
||||||
|
<option name="sourceFilePath" value="docker-compose.yaml" />
|
||||||
|
</settings>
|
||||||
|
</deployment>
|
||||||
|
<method v="2">
|
||||||
|
<option name="Gradle.BeforeRunTask" enabled="true" tasks="build" externalProjectPath="$PROJECT_DIR$" vmOptions="" scriptParameters="" />
|
||||||
|
</method>
|
||||||
|
</configuration>
|
||||||
|
</component>
|
|
@ -3,60 +3,29 @@ version: '3.5'
|
||||||
services:
|
services:
|
||||||
# Handle the coordination between the kafka images
|
# Handle the coordination between the kafka images
|
||||||
zookeeper:
|
zookeeper:
|
||||||
image: strimzi/kafka:0.19.0-kafka-2.5.0
|
image: bitnami/zookeeper
|
||||||
command: [
|
|
||||||
"sh", "-c",
|
|
||||||
"bin/zookeeper-server-start.sh config/zookeeper.properties"
|
|
||||||
]
|
|
||||||
ports:
|
ports:
|
||||||
- "2181:2181"
|
- "2181:2181"
|
||||||
environment:
|
environment:
|
||||||
LOG_DIR: /tmp/logs
|
- ALLOW_ANONYMOUS_LOGIN=yes
|
||||||
|
volumes:
|
||||||
|
- "zookeeper_data:/bitnami"
|
||||||
networks:
|
networks:
|
||||||
- kafka
|
- kafka
|
||||||
|
|
||||||
# The event system
|
# The event system
|
||||||
kafka:
|
kafka:
|
||||||
image: strimzi/kafka:0.19.0-kafka-2.5.0
|
image: bitnami/kafka
|
||||||
command: [
|
|
||||||
"sh", "-c",
|
|
||||||
"bin/kafka-server-start.sh config/server.properties --override listeners=$${KAFKA_LISTENERS} --override advertised.listeners=$${KAFKA_ADVERTISED_LISTENERS} --override zookeeper.connect=$${KAFKA_ZOOKEEPER_CONNECT} --override num.partitions=$${KAFKA_NUM_PARTITIONS} --override group.min.session.timeout.ms=$${KAFKA_GROUP_MIN_SESSION_TIMEOUT_MS}"
|
|
||||||
]
|
|
||||||
depends_on:
|
|
||||||
- zookeeper
|
|
||||||
ports:
|
ports:
|
||||||
- "9092:9092"
|
- "9092:9092"
|
||||||
environment:
|
environment:
|
||||||
LOG_DIR: "/tmp/logs"
|
- KAFKA_CFG_ZOOKEEPER_CONNECT=zookeeper:2181
|
||||||
KAFKA_ADVERTISED_LISTENERS: PLAINTEXT://kafka:9092
|
volumes:
|
||||||
KAFKA_LISTENERS: PLAINTEXT://0.0.0.0:9092
|
- "kafka_data:/bitnami"
|
||||||
KAFKA_ZOOKEEPER_CONNECT: zookeeper:2181
|
|
||||||
KAFKA_NUM_PARTITIONS: 3
|
|
||||||
KAFKA_GROUP_MIN_SESSION_TIMEOUT_MS: 100
|
|
||||||
networks:
|
|
||||||
- kafka
|
|
||||||
|
|
||||||
# Producer to a Kafka cluster
|
|
||||||
producer:
|
|
||||||
image: quarkus-quickstarts/kafka-streams-producer:1.0
|
|
||||||
build:
|
|
||||||
context: producer
|
|
||||||
dockerfile: src/main/docker/Dockerfile.${QUARKUS_MODE:-jvm}
|
|
||||||
environment:
|
|
||||||
KAFKA_BOOTSTRAP_SERVERS: kafka:9092
|
|
||||||
networks:
|
|
||||||
- kafka
|
|
||||||
|
|
||||||
# Aggregator to a Kafka cluster
|
|
||||||
aggregator:
|
|
||||||
image: quarkus-quickstarts/kafka-streams-aggregator:1.0
|
|
||||||
build:
|
|
||||||
context: aggregator
|
|
||||||
dockerfile: src/main/docker/Dockerfile.${QUARKUS_MODE:-jvm}
|
|
||||||
environment:
|
|
||||||
QUARKUS_KAFKA_STREAMS_BOOTSTRAP_SERVERS: kafka:9092
|
|
||||||
networks:
|
networks:
|
||||||
- kafka
|
- kafka
|
||||||
|
depends_on:
|
||||||
|
- zookeeper
|
||||||
|
|
||||||
# Our application
|
# Our application
|
||||||
application:
|
application:
|
||||||
|
@ -65,15 +34,21 @@ services:
|
||||||
dockerfile: ./src/main/docker/Dockerfile.${QUARKUS_MODE:-jvm}
|
dockerfile: ./src/main/docker/Dockerfile.${QUARKUS_MODE:-jvm}
|
||||||
environment:
|
environment:
|
||||||
KAFKA_BOOTSTRAP_SERVERS: kafka:9092
|
KAFKA_BOOTSTRAP_SERVERS: kafka:9092
|
||||||
|
networks:
|
||||||
|
- kafka
|
||||||
depends_on:
|
depends_on:
|
||||||
- zookeeper
|
- zookeeper
|
||||||
- kafka
|
- kafka
|
||||||
- producer
|
|
||||||
- aggregator
|
|
||||||
networks:
|
|
||||||
- kafka
|
|
||||||
|
|
||||||
networks:
|
networks:
|
||||||
# the Kafka network
|
# the Kafka network
|
||||||
kafka:
|
kafka:
|
||||||
name: kafka
|
name: kafka
|
||||||
|
|
||||||
|
volumes:
|
||||||
|
# the Zookeeper permanent data
|
||||||
|
zookeeper_data:
|
||||||
|
driver: local
|
||||||
|
# the Kafka permanent data
|
||||||
|
kafka_data:
|
||||||
|
driver: local
|
Loading…
Reference in a new issue