Newer
Older
EnvoyControlPlane / docker-compose.yml
version: "3.9"

services:
  # 1. The Envoy Control Plane
  envoy-control-plane:
    image: docker.jerxie.com/xds-server:latest
    container_name: envoy-control-plane
    restart: unless-stopped
    ports:
      # Exposes the gRPC XDS service port (18000) for the Envoy proxy to connect to
      - "${CONTROL_PLANE_DASHBOARD_PORT}:8080"
    volumes:
      # Uses the externally defined or default path
      - ${ENVOY_DATA_PATH}/data:/app/data:rw
    command: ["--node-id", "${ENVOY_NODE_ID}", "--config-dir", "/app/data/config","--db","file:/app/data/data.db?_foreign_keys=on", "--enable-cert-issuance", "webroot-path=/app/data/acme"]
    # Add a network to ensure both services can communicate
    networks:
      - envoy_network


  # 2. The Envoy Proxy
  envoy-proxy:
    # Use the official Envoy Docker image
    image: envoyproxy/envoy:v1.33.12 # Use a specific, stable version
    container_name: envoy-proxy
    restart: unless-stopped
    # Expose a port where the proxy will listen for client traffic (e.g., 11111 for admin, 10000,10001 for listener)
    ports:
      - "${ENVOY_HTTP_PORT}:10000"
      - "${ENVOY_HTTPS_PORT}:10001"
      - "${ENVOY_ADMIN_PORT}:11111"
    volumes:
      # Uses the externally defined or default path
      - ${ENVOY_DATA_PATH}/data/envoy_config:/etc/config:rw
    # The starting command you provided
    command: 
      - "envoy"
      - "-c"
      - "/etc/config/envoy.yaml"
    # Ensure this service waits for the control plane to be up
    depends_on:
      - envoy-control-plane
    # Connect to the same network as the control plane
    networks:
      - envoy_network
    
# Define a custom network for inter-service communication
networks:
  envoy_network:
    driver: bridge