Last active
December 8, 2022 12:52
-
-
Save dinesh-chander/67a47c68ee4a757eaf76952eaf885be1 to your computer and use it in GitHub Desktop.
redis and kafka docker-compose with ssl
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.10' | |
| services: | |
| redis: | |
| image: 'bitnami/redis:latest' | |
| environment: | |
| - ALLOW_EMPTY_PASSWORD=yes | |
| - REDIS_DISABLE_COMMANDS=FLUSHDB,FLUSHALL | |
| - REDIS_TLS_ENABLED=yes | |
| - REDIS_TLS_PORT_NUMBER=6379 | |
| - REDIS_TLS_CERT_FILE=/opt/bitnami/redis/certs/redis.crt | |
| - REDIS_TLS_KEY_FILE=/opt/bitnami/redis/certs/redis.key | |
| - REDIS_TLS_CA_FILE=/opt/bitnami/redis/certs/ca.crt | |
| - REDIS_TLS_AUTH_CLIENTS=yes | |
| ports: | |
| - '6379:6379' | |
| volumes: | |
| - ./certs/redis:/opt/bitnami/redis/certs | |
| - redis_data:/bitnami/redis/data | |
| zookeeper: | |
| image: 'bitnami/zookeeper:latest' | |
| ports: | |
| - '2181:2181' | |
| environment: | |
| - ALLOW_ANONYMOUS_LOGIN=yes | |
| volumes: | |
| - 'zookeeper_data:/bitnami' | |
| kafka: | |
| image: 'bitnami/kafka:latest' | |
| hostname: kafka.localhost | |
| depends_on: | |
| - zookeeper | |
| ports: | |
| - '9092:9093' | |
| environment: | |
| - KAFKA_SECURITY_PROTOCOL=SSL | |
| - KAFKA_TLS_TYPE=PEM | |
| - KAFKA_CFG_LISTENERS=PLAINTEXT://:9092,SSL://:9093 | |
| - KAFKA_CFG_ZOOKEEPER_CONNECT=zookeeper:2181 | |
| - KAFKA_CFG_ADVERTISED_LISTENERS=PLAINTEXT://localhost:9092,SSL://localhost:9093 | |
| - KAFKA_CFG_LISTENER_SECURITY_PROTOCOL_MAP=SSL:SSL,PLAINTEXT:PLAINTEXT | |
| - KAFKA_INTER_BROKER_LISTENER_NAME=PLAINTEXT | |
| - KAFKA_SSL_CLIENT_AUTH=required | |
| - ALLOW_PLAINTEXT_LISTENER=yes | |
| - KAFKA_CFG_SSL_ENDPOINT_IDENTIFICATION_ALGORITHM="" | |
| # - KAFKA_ZOOKEEPER_PROTOCOL=PLAINTEXT | |
| # - KAFKA_ZOOKEEPER_USER=zoo_client | |
| # - KAFKA_ZOOKEEPER_PASSWORD=zoo_password | |
| # - KAFKA_CLIENT_USERS=user | |
| # - KAFKA_CLIENT_PASSWORDS=password | |
| # - KAFKA_CERTIFICATE_PASSWORD=kafka12345 | |
| # - KAFKA_CFG_ZOOKEEPER_PROTOCOL=PLAINTEXT | |
| # - KAFKA_CFG_SSL_KEYSTORE_PASSWORD=secret | |
| # - KAFKA_CFG_SSL_KEY_PASSWORD=secret | |
| # - KAFKA_CFG_SSL_TRUSTSTORE_PASSWORD=secret | |
| # - KAFKA_SECURITY_INTER_BROKER_PROTOCOL=PLAINTEXT | |
| # - KAFKA_CFG_SSL_KEYSTORE_KEY="" | |
| # - KAFKA_TLS_TRUSTSTORE=/opt/bitnami/kafka/config/certs/zookeeper.truststore.jks | |
| # - KAFKA_CFG_SSL_TRUSTSTORE_LOCATION="123" | |
| # - KAFKA_CFG_SSL_KEYSTORE_LOCATION="123" | |
| volumes: | |
| - kafka_data:/bitnami/kafka | |
| - ./certs/kafka:/opt/bitnami/kafka/config/certs | |
| - ./certs/kafka/server.pem:/opt/bitnami/kafka/config/certs/kafka.keystore.pem | |
| - ./certs/kafka/server.key:/opt/bitnami/kafka/config/certs/kafka.keystore.key | |
| - ./certs/kafka/ca.pem:/opt/bitnami/kafka/config/certs/kafka.truststore.pem | |
| volumes: | |
| redis_data: | |
| driver: local | |
| zookeeper_data: | |
| driver: local | |
| kafka_data: | |
| driver: local |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment