version: "3.9" # ── Local development stack ──────────────────────────────────────────────────── # Usage: # docker compose up -d # docker compose logs -f backend # watch logs # docker compose exec backend python graph_seeder.py # seed real data # # Frontend: http://localhost:3000 # Backend: http://localhost:8000 # Neo4j Browser: http://localhost:7474 (neo4j / clinicalmatch2024) services: # ── Neo4j Community (free, no expiry) ──────────────────────────────────────── neo4j: image: neo4j:5.18-community container_name: clinicalmatch-neo4j restart: unless-stopped ports: - "7474:7474" # Neo4j Browser - "7687:7687" # Bolt volumes: - neo4j_data:/data - neo4j_logs:/logs environment: NEO4J_AUTH: "neo4j/clinicalmatch2024" NEO4J_PLUGINS: '["apoc"]' NEO4J_dbms_security_procedures_unrestricted: "apoc.*" NEO4J_dbms_security_procedures_allowlist: "apoc.*" NEO4J_server_memory_heap_initial__size: "512m" NEO4J_server_memory_heap_max__size: "1g" NEO4J_server_memory_pagecache_size: "256m" NEO4J_dbms_logs_query_enabled: "OFF" healthcheck: test: ["CMD-SHELL", "wget -qO- http://localhost:7476 || exit 1"] interval: 20s timeout: 10s retries: 10 start_period: 60s # ── FastAPI backend ─────────────────────────────────────────────────────────── backend: build: context: . dockerfile: docker/Dockerfile.backend container_name: clinicalmatch-backend restart: unless-stopped ports: - "8000:8000" depends_on: neo4j: condition: service_healthy env_file: .env.local environment: NEO4J_URI: "bolt://neo4j:7687" NEO4J_USERNAME: "neo4j" NEO4J_PASSWORD: "clinicalmatch2024" NEO4J_DATABASE: "neo4j" command: > sh -c "python3 neo4j_setup.py && python3 data_ingestion.py && uvicorn main:app --host 0.0.0.0 --port 8000 --workers 2" volumes: - ./backend:/app # hot-reload for local dev working_dir: /app # ── Next.js frontend ────────────────────────────────────────────────────────── frontend: build: context: . dockerfile: docker/Dockerfile.frontend container_name: clinicalmatch-frontend restart: unless-stopped ports: - "3000:3000" depends_on: - backend environment: NEXT_PUBLIC_API_URL: "http://localhost:8000" volumes: neo4j_data: neo4j_logs: