SPB Git

spb/trouve-ka Public

Trouve-KA — moteur de recherche web indépendant, Québec-first. Crawler distribué, index OpenSearch, ranking bilingue, galerie d'images. En prod : www.trouve-ka.com

Python 76.8% TypeScript 15.7% SQL 3.9% Shell 1.4% CSS 1.3% Dockerfile 0.7%
4.1 KB · 150 lines yaml
Raw Blame History
1# Trouve-KA — stack Docker Compose (dev local et déploiement m2m32)2# Author: Simon-Pierre Boucher3# Contact: contact@spboucher.ai4#5# Dimensionné pour m2m32 (32 Go RAM) : OpenSearch 2 Go de heap, Postgres léger,6# workers scalables via `docker compose up -d --scale crawler-worker=3`.78services:9  postgres:10    image: postgres:16-alpine11    environment:12      POSTGRES_USER: trouveka13      POSTGRES_PASSWORD: trouveka14      POSTGRES_DB: trouveka15    ports:16      - "${PG_PORT:-5432}:5432"17    volumes:18      - pgdata:/var/lib/postgresql/data19    healthcheck:20      test: ["CMD-SHELL", "pg_isready -U trouveka"]21      interval: 5s22      timeout: 3s23      retries: 202425  redis:26    image: redis:7-alpine27    ports:28      - "${REDIS_PORT:-6379}:6379"29    volumes:30      - redisdata:/data31    command: ["redis-server", "--appendonly", "yes"]32    healthcheck:33      test: ["CMD", "redis-cli", "ping"]34      interval: 5s35      timeout: 3s36      retries: 203738  opensearch:39    image: opensearchproject/opensearch:2.17.140    environment:41      discovery.type: single-node42      plugins.security.disabled: "true"43      OPENSEARCH_JAVA_OPTS: "-Xms2g -Xmx2g"44      OPENSEARCH_INITIAL_ADMIN_PASSWORD: "TrouveKA!Local1"45      bootstrap.memory_lock: "true"46    ulimits:47      memlock:48        soft: -149        hard: -150    ports:51      - "${SEARCH_PORT:-9200}:9200"52    volumes:53      - osdata:/usr/share/opensearch/data54    healthcheck:55      test: ["CMD-SHELL", "curl -sf http://localhost:9200/_cluster/health || exit 1"]56      interval: 10s57      timeout: 5s58      retries: 305960  api:61    build:62      context: .63      dockerfile: infrastructure/docker/backend.Dockerfile64    command: ["uvicorn", "trouveka.api.main:app", "--host", "0.0.0.0", "--port", "8080"]65    environment: &backend_env66      DATABASE_URL: postgresql://trouveka:trouveka@postgres:5432/trouveka67      REDIS_URL: redis://redis:6379/068      SEARCH_URL: http://opensearch:920069      ADMIN_TOKEN: ${ADMIN_TOKEN:-change-me-admin-token}70      PUBLIC_URL: ${PUBLIC_URL:-https://www.trouve-ka.com}71      MAX_GLOBAL_CONCURRENCY: ${MAX_GLOBAL_CONCURRENCY:-24}72      DEFAULT_HOST_DELAY: ${DEFAULT_HOST_DELAY:-2.0}73      MAX_RESPONSE_BYTES: ${MAX_RESPONSE_BYTES:-3000000}74    ports:75      - "8080:8080"76    depends_on:77      postgres:78        condition: service_healthy79      redis:80        condition: service_healthy81      opensearch:82        condition: service_healthy83    restart: unless-stopped8485  migrate:86    build:87      context: .88      dockerfile: infrastructure/docker/backend.Dockerfile89    command: ["python", "-c", "import asyncio; from trouveka.database import run_migrations; from trouveka.config import get_settings; print(asyncio.run(run_migrations(get_settings().database_url)))"]90    environment: *backend_env91    depends_on:92      postgres:93        condition: service_healthy94    restart: "no"9596  crawler-worker:97    build:98      context: .99      dockerfile: infrastructure/docker/backend.Dockerfile100    command: ["python", "-m", "trouveka.crawler.worker"]101    environment: *backend_env102    depends_on:103      migrate:104        condition: service_completed_successfully105      opensearch:106        condition: service_healthy107      redis:108        condition: service_healthy109    restart: unless-stopped110111  enrichment-worker:112    build:113      context: .114      dockerfile: infrastructure/docker/backend.Dockerfile115    command: ["python", "-m", "trouveka.enrichment.worker"]116    environment: *backend_env117    depends_on:118      migrate:119        condition: service_completed_successfully120    restart: unless-stopped121122  scheduler:123    build:124      context: .125      dockerfile: infrastructure/docker/backend.Dockerfile126    command: ["python", "-m", "trouveka.scheduler.loop"]127    environment: *backend_env128    depends_on:129      migrate:130        condition: service_completed_successfully131    restart: unless-stopped132133  web:134    build:135      context: .136      dockerfile: infrastructure/docker/web.Dockerfile137    environment:138      API_URL: http://api:8080139      PORT: "3000"140    ports:141      - "3000:3000"142    depends_on:143      - api144    restart: unless-stopped145146volumes:147  pgdata:148  redisdata:149  osdata:150