Fix Docker installation startup

This commit is contained in:
faligam
2026-09-06 13:01:01 +02:00
parent 8a918c9d86
commit ac905e7198
4 changed files with 12 additions and 10 deletions

View File

@@ -1,6 +1,7 @@
# Build context # Build context
.git .git
*.md *.md
!README.md
tests/ tests/
.env .env
*.example *.example

View File

@@ -18,10 +18,9 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
WORKDIR /build WORKDIR /build
COPY pyproject.toml ./ COPY pyproject.toml ./
RUN pip install --prefix=/install uvicorn fastapi pydantic pydantic-settings \ COPY README.md ./
httpx sqlalchemy asyncpg beautifulsoup4 selectolax trafilatura structlog
COPY src/ ./src/ COPY src/ ./src/
RUN pip install --prefix=/install .
# ---------- Runtime stage ---------- # ---------- Runtime stage ----------
FROM python:3.12-slim AS runtime FROM python:3.12-slim AS runtime
@@ -43,7 +42,6 @@ RUN mkdir -p /app/data && chown -R nsct:nsct /app/data
WORKDIR /app WORKDIR /app
COPY --from=builder /install /usr/local COPY --from=builder /install /usr/local
COPY src/ ./src/
RUN chown -R nsct:nsct /app RUN chown -R nsct:nsct /app

View File

@@ -51,7 +51,7 @@ services:
ports: ports:
- "8888:8080" - "8888:8080"
volumes: volumes:
- searxng_settings:/etc/searxng - searxng_cache:/var/cache/searxng
environment: environment:
- SEARXNG_BASE_URL=http://localhost:8888/ - SEARXNG_BASE_URL=http://localhost:8888/
- SEARXNG_SECRET_KEY=nsct_searxng_secret_key_change_me - SEARXNG_SECRET_KEY=nsct_searxng_secret_key_change_me
@@ -64,6 +64,7 @@ services:
read_only: true read_only: true
tmpfs: tmpfs:
- /tmp - /tmp
- /etc/searxng:mode=1777
cap_drop: cap_drop:
- ALL - ALL
@@ -79,6 +80,7 @@ services:
environment: environment:
NSCT_DB_URL: postgresql+asyncpg://${POSTGRES_USER:-nsct}:${POSTGRES_PASSWORD:-nsct_secret}@postgres:5432/${POSTGRES_DB:-nsct} 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_LLM_MAX_CONCURRENCY: "${NSCT_LLM_MAX_CONCURRENCY:-3}"
NSCT_SEARXNG_BASE_URL: http://searxng:8080/
depends_on: depends_on:
postgres: postgres:
condition: service_healthy condition: service_healthy
@@ -103,5 +105,5 @@ volumes:
driver: local driver: local
nsct_data: nsct_data:
driver: local driver: local
searxng_settings: searxng_cache:
driver: local driver: local

View File

@@ -22,6 +22,7 @@ dependencies = [
"uvicorn>=0.30.0", "uvicorn>=0.30.0",
"structlog>=24.0.0", "structlog>=24.0.0",
"openai>=3.3.1", "openai>=3.3.1",
"aiohttp>=3.10.0",
] ]
[project.optional-dependencies] [project.optional-dependencies]
@@ -45,7 +46,7 @@ nsct-api = "nsct.cli:main_api"
packages = ["src/nsct"] packages = ["src/nsct"]
[tool.hatch.build.targets.wheel] [tool.hatch.build.targets.wheel]
packages = ["nsct"] packages = ["src/nsct"]
[tool.pytest.ini_options] [tool.pytest.ini_options]
asyncio_mode = "auto" asyncio_mode = "auto"