Files
sientia-dataops-orchestrato…/docker-compose.yml
vitor-aignosi a4e4d3b085 SIENTIAPDE-1107
feat: add MongoDB integration and update configuration for activities
2025-06-16 12:05:56 -03:00

148 lines
4.7 KiB
YAML

version: '3.8'
services:
postgres:
image: postgres:15
container_name: postgres
environment:
POSTGRES_USER: sientia
POSTGRES_PASSWORD: sientia
POSTGRES_DB: sientia
ports:
- "5432:5432"
volumes:
- ./postgres_data:/var/lib/postgresql/data
networks:
- sientia-network
couchbase:
image: couchbase/server:7.2.0
container_name: couchbase
ports:
- "8091:8091" # Admin UI and REST API
- "8092:8092" # Query Service (N1QL)
- "8093:8093" # Index Service
- "8094:8094" # Search Service
- "11210:11210" # Data Service (KV)
- "18091:18091" # Analytics Service (if enabled)
environment:
CB_CLUSTER_USERNAME: sientia
CB_CLUSTER_PASSWORD: sientia
CB_CLUSTER_RAMSIZE: 256
CB_CLUSTER_INDEX_RAMSIZE: 256
volumes:
- ./couchbase_data:/opt/couchbase/var
networks:
- sientia-network
healthcheck:
test: ["CMD-SHELL", "curl -f http://localhost:8091/pools/default || exit 1"]
interval: 10s
timeout: 10s
retries: 5
redis:
image: redis:7-alpine # Using a lightweight Redis image
container_name: redis
ports:
- "6379:6379"
volumes:
- ./redis_data:/data # Persist Redis data
networks:
- sientia-network
redis-commander:
image: rediscommander/redis-commander:latest
container_name: redis-commander
environment:
REDIS_HOSTS: local:redis:6379 # Connects to the 'redis' service within the Docker network
ports:
- "8081:8081" # Access the Redis Commander UI on this port
depends_on:
- redis # Ensures Redis starts before Redis Commander
networks:
- sientia-network
kafka:
image: bitnami/kafka:3.7 # Using a specific Kafka version for stability
container_name: kafka
ports:
- "9092:9092" # For clients connecting from the host machine or outside Docker network
environment:
# KRaft (Kafka Raft without Zookeeper) settings
KAFKA_CFG_NODE_ID: '0'
KAFKA_CFG_PROCESS_ROLES: 'broker,controller'
KAFKA_CFG_CONTROLLER_LISTENER_NAMES: 'CONTROLLER'
# Listeners: <PROTOCOL>://<HOST/IP>:<PORT>
# PLAINTEXT_EXTERNAL for host access, INTERNAL for container-to-container communication
KAFKA_CFG_LISTENERS: 'PLAINTEXT_EXTERNAL://0.0.0.0:9092,INTERNAL://0.0.0.0:19092,CONTROLLER://0.0.0.0:9093'
# Advertised Listeners: How clients (including Kafka-UI) will connect
KAFKA_CFG_ADVERTISED_LISTENERS: 'PLAINTEXT_EXTERNAL://localhost:9092,INTERNAL://kafka:19092'
KAFKA_CFG_LISTENER_SECURITY_PROTOCOL_MAP: 'CONTROLLER:PLAINTEXT,PLAINTEXT_EXTERNAL:PLAINTEXT,INTERNAL:PLAINTEXT'
KAFKA_CFG_INTER_BROKER_LISTENER_NAME: 'INTERNAL'
KAFKA_CFG_CONTROLLER_QUORUM_VOTERS: '0@kafka:9093' # Node 0 is at kafka:9093 for controller comms
# Single node cluster settings (important for KRaft single node)
KAFKA_CFG_OFFSETS_TOPIC_REPLICATION_FACTOR: '1'
KAFKA_CFG_TRANSACTION_STATE_LOG_REPLICATION_FACTOR: '1'
KAFKA_CFG_TRANSACTION_STATE_LOG_MIN_ISR: '1'
KAFKA_CFG_DEFAULT_REPLICATION_FACTOR: '1' # For auto-created topics
KAFKA_CFG_NUM_PARTITIONS: '1' # Default partitions for auto-created topics
KAFKA_CFG_AUTO_CREATE_TOPICS_ENABLE: 'true' # Convenient for development
volumes:
- kafka_data:/bitnami/kafka # Bitnami Kafka data directory
networks:
- sientia-network
healthcheck:
# Checks if Kafka is ready by trying to list topics using the internal listener
test: ["CMD-SHELL", "/opt/bitnami/kafka/bin/kafka-topics.sh --bootstrap-server kafka:19092 --list > /dev/null || exit 1"]
interval: 30s
timeout: 10s
retries: 5
kafka-ui:
image: provectuslabs/kafka-ui:latest
container_name: kafka-ui
ports:
- "8082:8080" # Kafka UI will be accessible on host's port 8082
environment:
KAFKA_CLUSTERS_0_NAME: sientia-local-kafka
KAFKA_CLUSTERS_0_BOOTSTRAPSERVERS: kafka:19092 # Connects to Kafka's internal listener
# DYNAMIC_CONFIG_ENABLED: 'true' # Optional: To allow config changes through UI
depends_on:
kafka: # Ensures Kafka starts and is healthy before Kafka UI
condition: service_healthy
networks:
- sientia-network
mongodb:
image: mongo:7.0
container_name: mongodb
ports:
- "27017:27017"
environment:
MONGO_INITDB_ROOT_USERNAME: sientia
MONGO_INITDB_ROOT_PASSWORD: sientia
volumes:
- mongodb_data:/data/db
networks:
- sientia-network
networks:
sientia-network:
driver: bridge
volumes:
postgres_data:
driver: local
couchbase_data:
driver: local
redis_data:
driver: local
kafka_data:
driver: local
mongodb_data:
driver: local