|
| 1 | +# Hindsight API deployment with Nginx reverse proxy (API-only) |
| 2 | +# |
| 3 | +# This example deploys Hindsight API under the path /hindsight with: |
| 4 | +# - Hindsight standalone image (API + Control Plane + embedded pg0) |
| 5 | +# - Nginx reverse proxy (API only) |
| 6 | +# |
| 7 | +# Quick Start: |
| 8 | +# docker-compose -f docker/docker-compose/nginx/docker-compose.yml up |
| 9 | +# |
| 10 | +# Access: |
| 11 | +# API (via nginx): http://localhost:8080/hindsight/docs |
| 12 | +# Control Plane (direct): http://localhost:9999 |
| 13 | +# |
| 14 | +# For full stack deployment (API + Control Plane both under /hindsight): |
| 15 | +# See README.md in this directory for instructions on building with basePath. |
| 16 | +# |
| 17 | +# Note: This configuration uses the published image (no build required). |
| 18 | +# Control Plane is served directly because Next.js basePath requires |
| 19 | +# build-time configuration. See README.md for the full stack option. |
| 20 | + |
| 21 | +services: |
| 22 | + # Hindsight (API + Control Plane + embedded pg0) |
| 23 | + hindsight: |
| 24 | + image: ghcr.io/vectorize-io/hindsight:latest |
| 25 | + ports: |
| 26 | + - "9999:9999" # Control Plane (direct access, not proxied) |
| 27 | + environment: |
| 28 | + # API base path for reverse proxy |
| 29 | + HINDSIGHT_API_BASE_PATH: /hindsight |
| 30 | + |
| 31 | + # LLM configuration |
| 32 | + # Using mock provider for testing (no API key needed) |
| 33 | + # For production, set OPENAI_API_KEY or ANTHROPIC_API_KEY and use a real provider |
| 34 | + HINDSIGHT_API_LLM_PROVIDER: ${HINDSIGHT_API_LLM_PROVIDER:-mock} |
| 35 | + HINDSIGHT_API_LLM_API_KEY: ${OPENAI_API_KEY:-not-needed-for-mock} |
| 36 | + HINDSIGHT_API_LLM_MODEL: ${HINDSIGHT_API_LLM_MODEL:-mock-model} |
| 37 | + |
| 38 | + # Production examples (uncomment and set appropriate API key): |
| 39 | + # HINDSIGHT_API_LLM_PROVIDER: openai |
| 40 | + # HINDSIGHT_API_LLM_API_KEY: ${OPENAI_API_KEY} |
| 41 | + # HINDSIGHT_API_LLM_MODEL: gpt-4o-mini |
| 42 | + |
| 43 | + # HINDSIGHT_API_LLM_PROVIDER: anthropic |
| 44 | + # HINDSIGHT_API_LLM_API_KEY: ${ANTHROPIC_API_KEY} |
| 45 | + # HINDSIGHT_API_LLM_MODEL: claude-sonnet-4-20250514 |
| 46 | + |
| 47 | + # Server config |
| 48 | + HINDSIGHT_API_HOST: 0.0.0.0 |
| 49 | + HINDSIGHT_API_PORT: 8888 |
| 50 | + HINDSIGHT_API_LOG_LEVEL: info |
| 51 | + |
| 52 | + # Control Plane config |
| 53 | + HINDSIGHT_CP_DATAPLANE_API_URL: http://localhost:8888 |
| 54 | + volumes: |
| 55 | + # Persist embedded pg0 database |
| 56 | + - hindsight_data:/app/data |
| 57 | + # Note: Ports not exposed - access via Nginx at localhost:8080/hindsight/ |
| 58 | + # To debug directly, uncomment these ports: |
| 59 | + # ports: |
| 60 | + # - "8888:8888" # API |
| 61 | + # - "9999:9999" # Control Plane |
| 62 | + healthcheck: |
| 63 | + test: ["CMD", "curl", "-f", "http://localhost:8888/hindsight/health"] |
| 64 | + interval: 10s |
| 65 | + timeout: 5s |
| 66 | + retries: 3 |
| 67 | + start_period: 30s |
| 68 | + networks: |
| 69 | + - hindsight |
| 70 | + |
| 71 | + # Nginx reverse proxy |
| 72 | + nginx: |
| 73 | + image: nginx:alpine |
| 74 | + ports: |
| 75 | + - "8080:80" |
| 76 | + volumes: |
| 77 | + - ./nginx.conf:/etc/nginx/nginx.conf:ro |
| 78 | + depends_on: |
| 79 | + hindsight: |
| 80 | + condition: service_healthy |
| 81 | + networks: |
| 82 | + - hindsight |
| 83 | + |
| 84 | +volumes: |
| 85 | + hindsight_data: |
| 86 | + |
| 87 | +networks: |
| 88 | + hindsight: |
0 commit comments