diff --git a/.dockerignore b/.dockerignore index d8a655a..0c197cc 100644 --- a/.dockerignore +++ b/.dockerignore @@ -1,7 +1,8 @@ # Build context .git *.md +!README.md tests/ .env *.example -*.lock \ No newline at end of file +*.lock diff --git a/Dockerfile b/Dockerfile index 84753e8..adcbf56 100644 --- a/Dockerfile +++ b/Dockerfile @@ -18,10 +18,9 @@ RUN apt-get update && apt-get install -y --no-install-recommends \ WORKDIR /build COPY pyproject.toml ./ -RUN pip install --prefix=/install uvicorn fastapi pydantic pydantic-settings \ - httpx sqlalchemy asyncpg beautifulsoup4 selectolax trafilatura structlog - +COPY README.md ./ COPY src/ ./src/ +RUN pip install --prefix=/install . # ---------- Runtime stage ---------- FROM python:3.12-slim AS runtime @@ -43,7 +42,6 @@ RUN mkdir -p /app/data && chown -R nsct:nsct /app/data WORKDIR /app COPY --from=builder /install /usr/local -COPY src/ ./src/ RUN chown -R nsct:nsct /app @@ -51,4 +49,4 @@ USER nsct EXPOSE 8080 -CMD ["uvicorn", "nsct.api.main:app", "--host", "0.0.0.0", "--port", "8080"] \ No newline at end of file +CMD ["uvicorn", "nsct.api.main:app", "--host", "0.0.0.0", "--port", "8080"] diff --git a/docker-compose.yml b/docker-compose.yml index 2a08c75..a4829ab 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -51,7 +51,7 @@ services: ports: - "8888:8080" volumes: - - searxng_settings:/etc/searxng + - searxng_cache:/var/cache/searxng environment: - SEARXNG_BASE_URL=http://localhost:8888/ - SEARXNG_SECRET_KEY=nsct_searxng_secret_key_change_me @@ -64,6 +64,7 @@ services: read_only: true tmpfs: - /tmp + - /etc/searxng:mode=1777 cap_drop: - ALL @@ -79,6 +80,7 @@ services: environment: NSCT_DB_URL: postgresql+asyncpg://${POSTGRES_USER:-nsct}:${POSTGRES_PASSWORD:-nsct_secret}@postgres:5432/${POSTGRES_DB:-nsct} NSCT_LLM_MAX_CONCURRENCY: "${NSCT_LLM_MAX_CONCURRENCY:-3}" + NSCT_SEARXNG_BASE_URL: http://searxng:8080/ depends_on: postgres: condition: service_healthy @@ -103,5 +105,5 @@ volumes: driver: local nsct_data: driver: local - searxng_settings: - driver: local \ No newline at end of file + searxng_cache: + driver: local diff --git a/pyproject.toml b/pyproject.toml index bcf0dd4..09c8b64 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -22,6 +22,7 @@ dependencies = [ "uvicorn>=0.30.0", "structlog>=24.0.0", "openai>=3.3.1", + "aiohttp>=3.10.0", ] [project.optional-dependencies] @@ -45,7 +46,7 @@ nsct-api = "nsct.cli:main_api" packages = ["src/nsct"] [tool.hatch.build.targets.wheel] -packages = ["nsct"] +packages = ["src/nsct"] [tool.pytest.ini_options] asyncio_mode = "auto"