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:
|
||||
# Handle the coordination between the kafka images
|
||||
zookeeper:
|
||||
image: strimzi/kafka:0.19.0-kafka-2.5.0
|
||||
command: [
|
||||
"sh", "-c",
|
||||
"bin/zookeeper-server-start.sh config/zookeeper.properties"
|
||||
]
|
||||
image: bitnami/zookeeper
|
||||
ports:
|
||||
- "2181:2181"
|
||||
environment:
|
||||
LOG_DIR: /tmp/logs
|
||||
- ALLOW_ANONYMOUS_LOGIN=yes
|
||||
volumes:
|
||||
- "zookeeper_data:/bitnami"
|
||||
networks:
|
||||
- kafka
|
||||
|
||||
# The event system
|
||||
kafka:
|
||||
image: strimzi/kafka:0.19.0-kafka-2.5.0
|
||||
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
|
||||
image: bitnami/kafka
|
||||
ports:
|
||||
- "9092:9092"
|
||||
environment:
|
||||
LOG_DIR: "/tmp/logs"
|
||||
KAFKA_ADVERTISED_LISTENERS: PLAINTEXT://kafka:9092
|
||||
KAFKA_LISTENERS: PLAINTEXT://0.0.0.0:9092
|
||||
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
|
||||
- KAFKA_CFG_ZOOKEEPER_CONNECT=zookeeper:2181
|
||||
volumes:
|
||||
- "kafka_data:/bitnami"
|
||||
networks:
|
||||
- kafka
|
||||
depends_on:
|
||||
- zookeeper
|
||||
|
||||
# Our application
|
||||
application:
|
||||
|
@ -65,15 +34,21 @@ services:
|
|||
dockerfile: ./src/main/docker/Dockerfile.${QUARKUS_MODE:-jvm}
|
||||
environment:
|
||||
KAFKA_BOOTSTRAP_SERVERS: kafka:9092
|
||||
networks:
|
||||
- kafka
|
||||
depends_on:
|
||||
- zookeeper
|
||||
- kafka
|
||||
- producer
|
||||
- aggregator
|
||||
networks:
|
||||
- kafka
|
||||
|
||||
networks:
|
||||
# the Kafka network
|
||||
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