services: # ------------------------------------------------------------------ # # Data plane — postgres, redis, opensearch. These come up by default. # In Docker Desktop the "agent-wiki" stack shows these three; click # Start to bring the whole data plane up, Stop to take it down. # # Native backend dev uses the host-bound ports: # postgres 127.0.0.1:5433 # redis 127.0.0.1:6380 # opensearch 127.0.0.1:9201 # ------------------------------------------------------------------ # postgres: image: ${AGENT_WIKI_POSTGRES_IMAGE:-postgres:17} environment: - POSTGRES_USER=postgres - POSTGRES_PASSWORD=postgres - POSTGRES_DB=agent_wiki volumes: - ./local_data/pgdata:/var/lib/postgresql/data expose: - "5432" ports: - "127.0.0.1:5433:5432" healthcheck: test: ["CMD-SHELL", "pg_isready -U postgres -d agent_wiki"] interval: 2s timeout: 3s retries: 30 redis: image: redis:7-alpine volumes: - redisdata:/data expose: - "6379" ports: - "127.0.0.1:6380:6379" healthcheck: test: ["CMD", "redis-cli", "ping"] interval: 2s timeout: 3s retries: 15 opensearch: image: opensearchproject/opensearch:2.17.0 environment: - discovery.type=single-node - OPENSEARCH_JAVA_OPTS=-Xms512m -Xmx512m - DISABLE_INSTALL_DEMO_CONFIG=true - DISABLE_SECURITY_PLUGIN=true volumes: - opensearchdata:/usr/share/opensearch/data expose: - "9200" ports: - "127.0.0.1:9201:9200" healthcheck: test: ["CMD-SHELL", "curl -s http://localhost:9200/_cluster/health | grep -qv '\"status\":\"red\"'"] interval: 5s timeout: 5s retries: 20 # ------------------------------------------------------------------ # # App plane — backend, workers, frontend, nginx. Gated behind the # ``app`` compose profile so a plain ``docker compose up`` brings up # the data plane only. Run ``docker compose --profile app up`` for # a full containerized stack. # ------------------------------------------------------------------ # backend: profiles: ["app"] image: ${AGENT_WIKI_BACKEND_IMAGE:-onyxdotapp/agent-wiki-backend:${IMAGE_TAG:-latest}} build: ./backend env_file: .env environment: - DATABASE_URL=postgresql://postgres:postgres@postgres:5432/agent_wiki - REDIS_URL=redis://redis:6379/0 - OPENSEARCH_URL=http://opensearch:9200 - WIKI_DIR=/data/wiki - DEV_MODE=true volumes: - ./local_data:/data expose: - "8080" depends_on: postgres: condition: service_healthy redis: condition: service_healthy opensearch: condition: service_healthy # Two worker pods (see backend/app/tasks/queues.py + run_worker.py). Queues # stay independent (own Redis stream + thread pool); pods are grouped to share # the ~185 MiB Python import-graph floor. Split by blast risk: the LLM-bound # `heavy` work (documents reconciliation, trigger eval) is quarantined so an # OOM can't take down the real-time/interactive/fast `light` tenants. worker-heavy: profiles: ["app"] image: ${AGENT_WIKI_BACKEND_IMAGE:-onyxdotapp/agent-wiki-backend:${IMAGE_TAG:-latest}} build: ./backend command: [ "python", "-m", "app.tasks.run_worker", "documents", "triggers", "automanage_offline", ] env_file: .env environment: - DATABASE_URL=postgresql://postgres:postgres@postgres:5432/agent_wiki - REDIS_URL=redis://redis:6379/0 - OPENSEARCH_URL=http://opensearch:9200 - WIKI_DIR=/data/wiki - DEV_MODE=true volumes: - ./local_data:/data depends_on: backend: condition: service_started postgres: condition: service_healthy redis: condition: service_healthy opensearch: condition: service_healthy worker-light: profiles: ["app"] image: ${AGENT_WIKI_BACKEND_IMAGE:-onyxdotapp/agent-wiki-backend:${IMAGE_TAG:-latest}} build: ./backend command: [ "python", "-m", "app.tasks.run_worker", "coedit", "automanage_nearline", "lightweight_maintenance", ] env_file: .env environment: - DATABASE_URL=postgresql://postgres:postgres@postgres:5432/agent_wiki - REDIS_URL=redis://redis:6379/0 - OPENSEARCH_URL=http://opensearch:9200 - WIKI_DIR=/data/wiki - DEV_MODE=true volumes: - ./local_data:/data depends_on: backend: condition: service_started postgres: condition: service_healthy redis: condition: service_healthy opensearch: condition: service_healthy frontend: profiles: ["app"] image: ${AGENT_WIKI_FRONTEND_IMAGE:-onyxdotapp/agent-wiki-frontend:${IMAGE_TAG:-latest}} build: ./frontend env_file: .env environment: - BACKEND_URL=http://backend:8080 expose: - "3000" depends_on: - backend nginx: profiles: ["app"] image: ${AGENT_WIKI_NGINX_IMAGE:-nginx:1.27-alpine} volumes: - ./nginx/nginx.conf:/etc/nginx/nginx.conf:ro,Z ports: # Keep in sync with PUBLIC_BASE_URL in .env — this is the port the # stack is reachable on, so links the backend mints point here. - "${AGENT_WIKI_PORT:-8090}:80" depends_on: - backend - frontend volumes: redisdata: opensearchdata: