version: '3'

services:
    connect:
      image: debezium/connect:1.7.0.Final
      ports:
      - 8083:8083
      - 5005:5005
      environment:
        LOG_LEVEL: INFO
        BOOTSTRAP_SERVERS: ${CONFLUENT_CLOUD_BOOTSTRAP_SERVERS}
        CONNECT_CONNECTOR_CLIENT_CONFIG_OVERRIDE_POLICY: All
        CONNECT_CONFIG_STORAGE_REPLICATION_FACTOR: 3
        CONNECT_OFFSET_STORAGE_REPLICATION_FACTOR: 3
        CONNECT_STATUS_STORAGE_REPLICATION_FACTOR: 3
        CONNECT_REQUEST_TIMEOUT_MS: 20000
        CONNECT_RETRY_BACKOFF_MS: 500
        CONNECT_PRODUCER_REQUEST_TIMEOUT_MS: 20000
        CONNECT_PRODUCER_RETRY_BACKOFF_MS: 500
        CONNECT_CONSUMER_REQUEST_TIMEOUT_MS: 20000
        CONNECT_CONSUMER_RETRY_BACKOFF_MS: 500
        CONNECT_OFFSET_FLUSH_INTERVAL_MS: 10000
        CONNECT_BOOTSTRAP_SERVERS: ${CLOUD_URL}
        KEY_CONVERTER: org.apache.kafka.connect.json.JsonConverter
        VALUE_CONVERTER: org.apache.kafka.connect.json.JsonConverter
        INTERNAL_KEY_CONVERTER: "org.apache.kafka.connect.json.JsonConverter"
        INTERNAL_VALUE_CONVERTER: "org.apache.kafka.connect.json.JsonConverter"
        CONNECT_SSL_ENDPOINT_IDENTIFICATION_ALGORITHM: https
        CONNECT_SECURITY_PROTOCOL: SASL_SSL
        CONNECT_SASL_MECHANISM: PLAIN
        CONNECT_SASL_JAAS_CONFIG: "org.apache.kafka.common.security.plain.PlainLoginModule required username='${CLOUD_TOKEN}' password='${CLOUD_SECRET}';"
        CONNECT_VALUE_CONVERTER_BASIC_AUTH_CREDENTIALS_SOURCE: USER_INFO
        CONNECT_VALUE_CONVERTER_SCHEMA_REGISTRY_BASIC_AUTH_USER_INFO: ${SCHEMA_REGISTRY_BASIC_AUTH}
        CONNECT_VALUE_CONVERTER_SCHEMA_REGISTRY_URL: ${SCHEMA_REGISTRY_URL}
        CONNECT_KEY_CONVERTER_BASIC_AUTH_CREDENTIALS_SOURCE: USER_INFO
        CONNECT_KEY_CONVERTER_SCHEMA_REGISTRY_BASIC_AUTH_USER_INFO: ${SCHEMA_REGISTRY_BASIC_AUTH}
        CONNECT_KEY_CONVERTER_SCHEMA_REGISTRY_URL: ${SCHEMA_REGISTRY_URL}
        CONNECT_PRODUCER_BOOTSTRAP_SERVERS: ${CLOUD_URL}
        CONNECT_PRODUCER_SSL_ENDPOINT_IDENTIFICATION_ALGORITHM: https
        CONNECT_PRODUCER_SECURITY_PROTOCOL: SASL_SSL
        CONNECT_PRODUCER_SASL_MECHANISM: PLAIN
        CONNECT_PRODUCER_SASL_JAAS_CONFIG: "org.apache.kafka.common.security.plain.PlainLoginModule required username='${CLOUD_TOKEN}' password='${CLOUD_SECRET}';"
        CONNECT_CONSUMER_BOOTSTRAP_SERVERS: ${CLOUD_URL}
        CONNECT_CONSUMER_SSL_ENDPOINT_IDENTIFICATION_ALGORITHM: https
        CONNECT_CONSUMER_SECURITY_PROTOCOL: SASL_SSL
        CONNECT_CONSUMER_SASL_MECHANISM: PLAIN
        CONNECT_CONSUMER_SASL_JAAS_CONFIG: "org.apache.kafka.common.security.plain.PlainLoginModule required username='${CLOUD_TOKEN}' password='${CLOUD_SECRET}';"
        CONNECT_DATABASE_HISTORY_KAFKA_BOOTSTRAP_SERVERS: ${CLOUD_URL}
        CONNECT_DATABASE_HISTORY_CONSUMER_SSL_ENDPOINT_IDENTIFICATION_ALGORITHM: https
        CONNECT_DATABASE_HISTORY_CONSUMER_SECURITY_PROTOCOL: SASL_SSL
        CONNECT_DATABASE_HISTORY_CONSUMER_SASL_MECHANISM: PLAIN
        CONNECT_DATABASE_HISTORY_CONSUMER_SASL_JAAS_CONFIG: "org.apache.kafka.common.security.plain.PlainLoginModule required username='${CLOUD_TOKEN}' password='${CLOUD_SECRET}';"
        CONNECT_DATABASE_HISTORY_PRODUCER_SSL_ENDPOINT_IDENTIFICATION_ALGORITHM: https
        CONNECT_DATABASE_HISTORY_PRODUCER_SECURITY_PROTOCOL: SASL_SSL
        CONNECT_DATABASE_HISTORY_PRODUCER_SASL_MECHANISM: PLAIN
        CONNECT_DATABASE_HISTORY_PRODUCER_SASL_JAAS_CONFIG: "org.apache.kafka.common.security.plain.PlainLoginModule required username='${CLOUD_TOKEN}' password='${CLOUD_SECRET}';"
        GROUP_ID: 1
        CONFIG_STORAGE_TOPIC: ${CONFIG_STORAGE_TOPIC} 
        OFFSET_STORAGE_TOPIC: ${OFFSET_STORAGE_TOPIC}
        STATUS_STORAGE_TOPIC: ${STATUS_STORAGE_TOPIC}
