Last active
May 12, 2023 16:54
-
-
Save antunesleo/120b4906ec45c94f9ab3b78acbe16a9e to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
version: '3.7' | |
networks: | |
my_network: | |
services: | |
zookeeper: | |
image: confluentinc/cp-zookeeper:latest | |
hostname: zookeeper | |
environment: | |
ZOOKEEPER_CLIENT_PORT: 2181 | |
ZOOKEPER_SSL_ENABLED: 'false' | |
ports: | |
- "2181:2181" | |
networks: | |
- my_network | |
healthcheck: | |
test: [ "CMD", "nc", "-z", "localhost", "2181" ] | |
interval: 12s | |
timeout: 6s | |
retries: 8 | |
kafka: | |
image: confluentinc/cp-kafka:latest | |
container_name: kafka | |
depends_on: | |
zookeeper: | |
condition: service_healthy | |
ports: | |
- "9092:9092" | |
environment: | |
KAFKA_ZOOKEEPER_CONNECT: zookeeper:2181 | |
KAFKA_ADVERTISED_LISTENERS: PLAINTEXT://kafka:9092 | |
KAFKA_OFFSETS_TOPIC_REPLICATION_FACTOR: 1 | |
networks: | |
- my_network | |
healthcheck: | |
test: ["CMD-SHELL", "kafka-topics --bootstrap-server kafka:9092 --list"] | |
interval: 12s | |
timeout: 6s | |
retries: 8 | |
api: | |
build: . | |
command: python manage.py runserver 0.0.0.0:8000 | |
volumes: | |
- .:/app | |
env_file: | |
- .env | |
ports: | |
- "8000:8000" | |
networks: | |
- my_network | |
depends_on: | |
kafka: | |
condition: service_healthy |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment