On Docker External Services Integration Plan - robbiemu/aclarai GitHub Wiki

Docker and External Services Integration Plan

Overview

This document outlines the configuration plan for integrating Docker service components with external services. It will guide developers on how to set up and switch between local Docker services and external ones, ensuring both development flexibility and deployment consistency.

Configuration Flags

Two primary configuration mechanisms are introduced to handle service connections flexibly:

  1. Prefer Docker Services Flag

    • Description: This application-level flag determines if Docker service names are preferred over user-configured service URLs.
    • Default: true
    • Usage: Set this to false when running with external services configured by the user.
  2. Use External Service Flags (Env-Based)

    • Description: These environment variables dictate whether Docker Compose should start the respective service or rely on the user's external setup.
    • Examples:
      • USE_EXTERNAL_POSTGRES
      • USE_EXTERNAL_NEO4J
      • USE_EXTERNAL_RABBITMQ

Scenarios

Scenario 1: Full Docker Stack (Default)

  • Prefer Docker Services: true
  • External Service Flags: false or unset
  • Both the application and Docker Compose will use Docker services.

Scenario 2: Using External Services

  • Prefer Docker Services: false
  • External Service Flags: true
  • Application uses user-configured URLs; Docker Compose skips starting these services.

Scenario 3: Mixed Environment

  • Prefer Docker Services: false
  • Select External Service Flags: Mixed true/false
  • Some services run as Docker containers, others are external based on flag settings.

Implementation Considerations

  • Update the default YAML configuration to include a prefer_docker_services flag.
  • Introduce environment variables for Docker Compose conditional service inclusion.
  • Harmonize application logic to respect these flags, enhancing both local dev and CI/CD processes.

Documentation and Tutorials

  • A detailed setup guide for developers will be provided, explaining configuration options and usage scenarios.
  • tutorials will walk users through switching between full Docker, full external, and mixed setups.