- Add vector store with sentence-transformers for semantic search - FastAPI backend with /chat and /health endpoints - Conversation state persistence via SQLite - OpenRouter integration with structured JSON responses - Discord bot with /ask slash command and reply-based follow-ups - Automated Gitea issue creation for unanswered questions - Docker support with docker-compose for easy deployment - Example rule file and ingestion script - Comprehensive documentation in README
49 lines
1.1 KiB
Docker
49 lines
1.1 KiB
Docker
# Multi-stage build for Strat-Chatbot
|
|
FROM python:3.12-slim AS builder
|
|
|
|
WORKDIR /app
|
|
|
|
# Install system dependencies for sentence-transformers (PyTorch, etc.)
|
|
RUN apt-get update && apt-get install -y --no-install-recommends \
|
|
gcc \
|
|
g++ \
|
|
&& rm -rf /var/lib/apt/lists/*
|
|
|
|
# Install Poetry
|
|
RUN pip install --no-cache-dir poetry
|
|
|
|
# Copy dependencies
|
|
COPY pyproject.toml ./
|
|
COPY README.md ./
|
|
|
|
# Install dependencies
|
|
RUN poetry config virtualenvs.in-project true && \
|
|
poetry install --no-interaction --no-ansi --only main
|
|
|
|
# Final stage
|
|
FROM python:3.12-slim
|
|
|
|
WORKDIR /app
|
|
|
|
# Copy virtual environment from builder
|
|
COPY --from=builder /app/.venv .venv
|
|
ENV PATH="/app/.venv/bin:$PATH"
|
|
|
|
# Create non-root user
|
|
RUN useradd --create-home --shell /bin/bash app && chown -R app:app /app
|
|
USER app
|
|
|
|
# Copy application code
|
|
COPY --chown=app:app app/ ./app/
|
|
COPY --chown=app:app data/ ./data/
|
|
COPY --chown=app:app scripts/ ./scripts/
|
|
|
|
# Create data directories
|
|
RUN mkdir -p data/chroma data/rules
|
|
|
|
# Expose ports
|
|
EXPOSE 8000
|
|
|
|
# Run FastAPI server
|
|
CMD ["uvicorn", "app.main:app", "--host", "0.0.0.0", "--port", "8000"]
|