docker-compose-macos.yml


Overview

docker-compose-macos.yml is a Docker Compose configuration file tailored for macOS environments. Its primary purpose is to define and orchestrate multi-container Docker applications, specifically for running the Ragflow service along with its dependencies. This file extends a base configuration (docker-compose-base.yml) and customizes the service definitions to suit macOS-specific platform requirements and development workflows.

The configuration ensures proper service dependencies, platform compatibility (targeting linux/amd64), port mappings, environment variable management, volume mounts for persistent storage and configuration, and network setup. Additionally, it includes commented-out configuration snippets for an optional executor service, providing a template for future scalability or parallel task execution.


Detailed Explanation

Top-level keys


Services

ragflow

This is the main application service running the Ragflow server.

Property

Description

platform

Specifies the target platform architecture (linux/amd64). Important since macOS uses ARM architecture on Apple Silicon, but Ragflow requires amd64 compatibility.

depends_on

Ensures the mysql service is healthy before starting Ragflow, guaranteeing database availability.

build

Defines the build context and Dockerfile location to build the Ragflow image locally.

container_name

Sets a fixed container name: ragflow-server.

ports


Commented-out executor service

This service is currently disabled (commented out) but provides an example for an executor container that depends on MySQL and shares volumes and environment settings with ragflow. It uses a pre-built image defined by ${RAGFLOW_IMAGE} and runs an entrypoint script with parameters.


Important Implementation Details


Interaction with Other Parts of the System


Usage Example

To start the Ragflow service on macOS:

# Ensure your .env file is properly configured with required variables.
docker-compose -f docker-compose-macos.yml up --build

This command will build and start the ragflow container after ensuring MySQL is healthy. Logs and config files will be accessible on the host via mounted volumes.


Mermaid Diagram: Service Workflow

The following flowchart visualizes the service dependencies and key runtime relationships defined in this Compose file.

flowchart TD
    A[Start Ragflow Service] -->|depends_on healthy| B[MySQL Service]
    B --> C{MySQL Healthy?}
    C -- Yes --> A
    C -- No --> B

    A --> D[Build Ragflow Image]
    D --> E[Run Ragflow Container]
    E --> F[Expose Ports 9380, 80, 443]
    E --> G[Mount Volumes: Logs, Nginx Configs]
    E --> H[Set Environment Variables]
    E --> I[Connect to ragflow Network]
    E --> J[Restart on Failure]

    style A fill:#f9f,stroke:#333,stroke-width:2px
    style B fill:#bbf,stroke:#333,stroke-width:1.5px
    style C fill:#f96,stroke:#333,stroke-width:1.5px
    style E fill:#afa,stroke:#333,stroke-width:1.5px

Summary

This file plays a critical role in streamlining local development and deployment of the Ragflow application on macOS systems.