Verified catalogue of mobiles and laptops sold in India, collected from real retail listings (FastAPI backend, React frontend, Postgres/pgvector). - REST API under /api/elec (read-only catalogue; admin endpoints need login) - MCP server (FastMCP) at /mcp/ with list_categories, search_products, get_product and price_history tools - Real ratings and reviews read from product pages and search results - Production Dockerfile (requirements-api.txt, no PyTorch) and .env.production.example; remote database only via an explicit ELEC_ALLOW_REMOTE_DB host/name allowlist - docs/API.md: endpoint and MCP reference with live examples Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
34 lines
1.1 KiB
YAML
34 lines
1.1 KiB
YAML
# Local-only PostgreSQL + pgvector for the Electronics Catalog.
|
|
#
|
|
# Names are deliberately different from the grocery project's
|
|
# (catalog_rag_postgres / catalog_rag_pgdata / port 5432) so the two can never
|
|
# share a container, a volume or a port. Bound to 127.0.0.1: not reachable
|
|
# from the network.
|
|
#
|
|
# docker compose up -d
|
|
#
|
|
# Ollama runs natively on Windows (http://localhost:11434), not in Docker.
|
|
services:
|
|
postgres:
|
|
image: pgvector/pgvector:pg16
|
|
container_name: elec_catalog_pg
|
|
restart: unless-stopped
|
|
environment:
|
|
POSTGRES_DB: electronics_catalog
|
|
POSTGRES_USER: postgres
|
|
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:?Set POSTGRES_PASSWORD in the root .env}
|
|
# Small footprint for an 8 GB laptop that also runs Ollama and MiniLM.
|
|
command: ["postgres", "-c", "shared_buffers=256MB", "-c", "work_mem=16MB", "-c", "max_connections=40"]
|
|
ports:
|
|
- "127.0.0.1:5433:5432"
|
|
volumes:
|
|
- elec_catalog_pgdata:/var/lib/postgresql/data
|
|
healthcheck:
|
|
test: ["CMD-SHELL", "pg_isready -U postgres -d electronics_catalog"]
|
|
interval: 5s
|
|
timeout: 5s
|
|
retries: 20
|
|
|
|
volumes:
|
|
elec_catalog_pgdata:
|