* feat: add reverse proxy support * improve * improve * improve * improve * improve * fix: update integration test to use modern 'docker compose' command - Replace 'docker-compose' with 'docker compose' (Docker Compose v2+) - Add fallback to legacy docker-compose command for compatibility - Fixes test failures on systems using Docker Compose plugin * ci: trigger test rerun * fix: make docker-compose detection more robust for CI - Add get_docker_compose_command() to detect available command - Use shutil.which() to check command availability - Dynamically use correct command (docker compose vs docker-compose) - Should work in both modern and legacy Docker environments * fix: docker-compose networking in base path integration test Fix connection refused error in test_reverse_proxy_simple_config by handling host vs bridge networking modes correctly: - Linux (host mode): nginx listens on 18080 directly, no port mapping - Mac/Windows (bridge mode): nginx listens on 80, mapped to 18080 With host networking, port mappings in docker-compose don't work since the container binds directly to the host's network namespace.
88 lines
2.8 KiB
YAML
88 lines
2.8 KiB
YAML
# Hindsight API deployment with Nginx reverse proxy (API-only)
|
|
#
|
|
# This example deploys Hindsight API under the path /hindsight with:
|
|
# - Hindsight standalone image (API + Control Plane + embedded pg0)
|
|
# - Nginx reverse proxy (API only)
|
|
#
|
|
# Quick Start:
|
|
# docker-compose -f docker/docker-compose/nginx/docker-compose.yml up
|
|
#
|
|
# Access:
|
|
# API (via nginx): http://localhost:8080/hindsight/docs
|
|
# Control Plane (direct): http://localhost:9999
|
|
#
|
|
# For full stack deployment (API + Control Plane both under /hindsight):
|
|
# See README.md in this directory for instructions on building with basePath.
|
|
#
|
|
# Note: This configuration uses the published image (no build required).
|
|
# Control Plane is served directly because Next.js basePath requires
|
|
# build-time configuration. See README.md for the full stack option.
|
|
|
|
services:
|
|
# Hindsight (API + Control Plane + embedded pg0)
|
|
hindsight:
|
|
image: ghcr.io/vectorize-io/hindsight:latest
|
|
ports:
|
|
- "9999:9999" # Control Plane (direct access, not proxied)
|
|
environment:
|
|
# API base path for reverse proxy
|
|
HINDSIGHT_API_BASE_PATH: /hindsight
|
|
|
|
# LLM configuration
|
|
# Using mock provider for testing (no API key needed)
|
|
# For production, set OPENAI_API_KEY or ANTHROPIC_API_KEY and use a real provider
|
|
HINDSIGHT_API_LLM_PROVIDER: ${HINDSIGHT_API_LLM_PROVIDER:-mock}
|
|
HINDSIGHT_API_LLM_API_KEY: ${OPENAI_API_KEY:-not-needed-for-mock}
|
|
HINDSIGHT_API_LLM_MODEL: ${HINDSIGHT_API_LLM_MODEL:-mock-model}
|
|
|
|
# Production examples (uncomment and set appropriate API key):
|
|
# HINDSIGHT_API_LLM_PROVIDER: openai
|
|
# HINDSIGHT_API_LLM_API_KEY: ${OPENAI_API_KEY}
|
|
# HINDSIGHT_API_LLM_MODEL: gpt-4o-mini
|
|
|
|
# HINDSIGHT_API_LLM_PROVIDER: anthropic
|
|
# HINDSIGHT_API_LLM_API_KEY: ${ANTHROPIC_API_KEY}
|
|
# HINDSIGHT_API_LLM_MODEL: claude-sonnet-4-20250514
|
|
|
|
# Server config
|
|
HINDSIGHT_API_HOST: 0.0.0.0
|
|
HINDSIGHT_API_PORT: 8888
|
|
HINDSIGHT_API_LOG_LEVEL: info
|
|
|
|
# Control Plane config
|
|
HINDSIGHT_CP_DATAPLANE_API_URL: http://localhost:8888
|
|
volumes:
|
|
# Persist embedded pg0 database
|
|
- hindsight_data:/app/data
|
|
# Note: Ports not exposed - access via Nginx at localhost:8080/hindsight/
|
|
# To debug directly, uncomment these ports:
|
|
# ports:
|
|
# - "8888:8888" # API
|
|
# - "9999:9999" # Control Plane
|
|
healthcheck:
|
|
test: ["CMD", "curl", "-f", "http://localhost:8888/hindsight/health"]
|
|
interval: 10s
|
|
timeout: 5s
|
|
retries: 3
|
|
start_period: 30s
|
|
networks:
|
|
- hindsight
|
|
|
|
# Nginx reverse proxy
|
|
nginx:
|
|
image: nginx:alpine
|
|
ports:
|
|
- "8080:80"
|
|
volumes:
|
|
- ./nginx.conf:/etc/nginx/nginx.conf:ro
|
|
depends_on:
|
|
hindsight:
|
|
condition: service_healthy
|
|
networks:
|
|
- hindsight
|
|
|
|
volumes:
|
|
hindsight_data:
|
|
|
|
networks:
|
|
hindsight:
|