| |
| |
|
|
| FROM python:3.12-slim AS base |
|
|
| |
| RUN apt-get update && apt-get install -y --no-install-recommends \ |
| curl git build-essential \ |
| && rm -rf /var/lib/apt/lists/* |
|
|
| |
| RUN curl -LsSf https://astral.sh/uv/install.sh | sh |
| ENV PATH="/root/.cargo/bin:/root/.local/bin:$PATH" |
|
|
| WORKDIR /app |
|
|
| |
| COPY pyproject.toml ./ |
|
|
| |
| RUN uv pip install --system --no-cache \ |
| fastapi uvicorn[standard] websockets pydantic pydantic-settings \ |
| litellm groq qdrant-client fastembed \ |
| redis[hiredis] aiokafka structlog httpx \ |
| python-multipart xxhash neo4j python-dotenv orjson \ |
| anyio tenacity prefect |
|
|
| |
| COPY . . |
|
|
| |
| RUN mkdir -p /tmp/fastembed_cache |
|
|
| |
| RUN useradd -m -u 1000 appuser && chown -R appuser:appuser /app /tmp/fastembed_cache |
| USER appuser |
|
|
| |
| EXPOSE 7860 |
|
|
| |
| HEALTHCHECK --interval=30s --timeout=10s --start-period=60s --retries=3 \ |
| CMD curl -f http://localhost:7860/health || exit 1 |
|
|
| CMD ["python", "hf_main.py"] |
|
|