docker-compose-base.yml


Overview

docker-compose-base.yml is a Docker Compose configuration file designed to orchestrate a multi-service application stack primarily focused on data indexing, storage, and processing. It defines the deployment of core infrastructure services such as Elasticsearch, OpenSearch, MySQL, Redis, MinIO, and custom components like Infinity and Sandbox Executor Manager. Each service is configured with environment variables, resource limits, health checks, and network settings to ensure reliable operation within a Docker-based environment.

This base compose file is intended to provide foundational service definitions that can be extended or overridden by other compose files or profiles depending on deployment needs. It supports profile-based service activation, enabling selective startup of services based on the context (e.g., development, testing, or production).


Detailed Service Descriptions

1. Elasticsearch Service (es01)

Usage example:

docker-compose -f docker-compose-base.yml --profile elasticsearch up -d

2. OpenSearch Service (opensearch01)


3. Infinity Service (infinity)


4. Sandbox Executor Manager (sandbox-executor-manager)


5. MySQL Service (mysql)


6. MinIO Service (minio)


7. Redis Service (redis)


Volumes

The compose file defines several named volumes to persist data across container restarts:

All volumes use the local driver.


Networks


Important Implementation Details


Interactions with Other System Components


Usage Example

To start the Elasticsearch and MySQL services only:

docker-compose -f docker-compose-base.yml --profile elasticsearch --profile mysql up -d

To bring up the full stack (assuming all profiles enabled):

docker-compose -f docker-compose-base.yml up -d

Mermaid Diagram

Below is a flowchart illustrating the relationships and key configurations between the services defined in this compose file.

flowchart TD
    subgraph "Network: ragflow"
        ES[Elasticsearch (es01)]
        OS[OpenSearch (opensearch01)]
        INF[Infinity]
        SANDBOX[Sandbox Executor Manager]
        MYSQL[MySQL]
        MINIO[MinIO]
        REDIS[Redis]
    end

    ES -- Data Volume --> esdata01[Volume: esdata01]
    OS -- Data Volume --> osdata01[Volume: osdata01]
    INF -- Data Volume --> infinity_data[Volume: infinity_data]
    MYSQL -- Data Volume --> mysql_data[Volume: mysql_data]
    MINIO -- Data Volume --> minio_data[Volume: minio_data]
    REDIS -- Data Volume --> redis_data[Volume: redis_data]

    SANDBOX -- Mounts --> docker_sock[/var/run/docker.sock]

    INF -->|Connects to| MYSQL
    INF -->|Uses| REDIS
    INF -->|Stores objects| MINIO
    SANDBOX -->|Manages| INF

    style esdata01 fill:#f9f,stroke:#333,stroke-width:1px
    style osdata01 fill:#f9f,stroke:#333,stroke-width:1px
    style infinity_data fill:#f9f,stroke:#333,stroke-width:1px
    style mysql_data fill:#f9f,stroke:#333,stroke-width:1px
    style minio_data fill:#f9f,stroke:#333,stroke-width:1px
    style redis_data fill:#f9f,stroke:#333,stroke-width:1px

Summary

docker-compose-base.yml is a robust, modular Docker Compose configuration that defines essential services for a data-centric application stack. It emphasizes configurability via environment variables, service health monitoring, resource management, and network isolation. The file is intended as a foundational layer to be extended or combined with other configurations for specific deployment scenarios.