Skip to content

armgit / ODS

Public Imported from GitHub
0

ODS V3 Pre-Release: Public testing and refinement ahead of the official V3 launch. Turn your PC, Mac, or Linux box into a private AI server.

2.6 KB
Raw Blame
services:
  perplexica:
    extra_hosts:
      - "host.docker.internal:host-gateway"
    image: itzcrazykns1337/vane:v1.12.2@sha256:61f2bbf3386ff3df08911fb3de0e1893b04702a4d49ef13fbadbda937b47ab7c
    container_name: ods-perplexica
    restart: unless-stopped
    security_opt:
      - no-new-privileges:true
    environment:
      - SEARXNG_API_URL=http://searxng:8080
      - PERPLEXICA_SEARXNG_API_URL=${PERPLEXICA_SEARXNG_API_URL:-}
      - OPENAI_BASE_URL=${HERMES_LLM_BASE_URL:-${LLM_API_URL:-http://llama-server:8080}/v1}
      - OPENAI_API_KEY=${HERMES_LLM_API_KEY:-${LITELLM_KEY:-${OPENAI_API_KEY:-no-key}}}
      - ODS_MODE=${ODS_MODE:-local}
      - ODS_MODEL_SWITCHBOARD=${ODS_MODEL_SWITCHBOARD:-enabled}
      - LLM_MODEL=${LLM_MODEL:-}
      - GGUF_FILE=${GGUF_FILE:-}
      - EXTERNAL_LLM_URL=${EXTERNAL_LLM_URL:-}
      - EXTERNAL_LLM_MODEL=${EXTERNAL_LLM_MODEL:-}
      - HOSTNAME=0.0.0.0
      - PERPLEXICA_SCRAPE_URL_MAX_CHARS=${PERPLEXICA_SCRAPE_URL_MAX_CHARS:-30000}
    entrypoint: ["/bin/sh", "-c", "until [ -f /app/ods-entrypoint.sh ]; do sleep 0.5; done; exec /bin/sh /app/ods-entrypoint.sh \"$@\"", "ods-entrypoint"]
    # Docker drops the image CMD when `entrypoint:` is overridden, so the
    # upstream command (`node server.js`) must be restated here. Without this
    # the patched entrypoint exits 0 with no app process, restart-looping.
    command: ["node", "server.js"]
    volumes:
      - perplexica-data:/home/vane/data
      - perplexica-uploads:/home/vane/uploads
      - ./extensions/services/perplexica/docker-entrypoint.sh:/app/ods-entrypoint.sh:ro,z
      - ./extensions/services/perplexica/patch-client-citations.js:/app/ods-patch-client-citations.js:ro,z
      - ./extensions/services/perplexica/citation-renderer.js:/app/citation-renderer.js:ro,z
      - ./extensions/services/perplexica/sync-model-config.js:/app/ods-sync-model-config.js:ro,z
      - ./extensions/services/perplexica/sync-search-config.js:/app/ods-sync-search-config.js:ro,z
    ports:
      - "127.0.0.1:${PERPLEXICA_PORT:-3004}:3000"
    deploy:
      resources:
        limits:
          cpus: '2.0'
          memory: 2G
        reservations:
          cpus: '0.25'
          memory: 256M
    healthcheck:
      test: ["CMD", "node", "-e", "const h=require('http');h.get('http://127.0.0.1:3000/',r=>{process.exit(r.statusCode===200?0:1)}).on('error',()=>process.exit(1))"]
      interval: 30s
      timeout: 10s
      retries: 3
      start_period: 30s
    logging:
      driver: "json-file"
      options:
        max-size: "10m"
        max-file: "3"

volumes:
  perplexica-data:
  perplexica-uploads: