Full backend service with: - FastAPI REST API with CRUD, search, reprocess endpoints - PostgreSQL + pgvector for items and semantic search - Redis + RQ for background job processing - Meilisearch for fast keyword/filter search - Browserless/Chrome for JS rendering and screenshots - OpenAI structured output for AI classification - Local file storage with S3-ready abstraction - Gateway auth via X-Gateway-User-Id header - Own docker-compose stack (6 containers) Classification: fixed folders (Home/Family/Work/Travel/Knowledge/Faith/Projects) and fixed tags (28 predefined). AI assigns exactly 1 folder, 2-3 tags, title, summary, and confidence score per item. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
20 lines
538 B
Docker
20 lines
538 B
Docker
FROM python:3.12-slim
|
|
|
|
WORKDIR /app
|
|
|
|
RUN apt-get update && apt-get install -y --no-install-recommends libpq-dev && rm -rf /var/lib/apt/lists/*
|
|
RUN pip install --no-cache-dir --upgrade pip
|
|
|
|
COPY requirements.txt .
|
|
RUN pip install --no-cache-dir -r requirements.txt
|
|
|
|
RUN adduser --disabled-password --no-create-home appuser
|
|
RUN mkdir -p /app/storage && chown -R appuser /app/storage
|
|
|
|
COPY --chown=appuser app/ app/
|
|
|
|
ENV PYTHONUNBUFFERED=1
|
|
|
|
USER appuser
|
|
CMD ["rq", "worker", "brain", "--url", "redis://brain-redis:6379/0", "--path", "/app"]
|