- Use /app/venv with uv instead of system python/pip - Pre-download all-MiniLM-L6-v2 model during Docker build Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
25 lines
781 B
Docker
25 lines
781 B
Docker
# Stage 1: Build frontend
|
|
FROM node:22-alpine AS frontend
|
|
WORKDIR /app/web
|
|
COPY web/package.json web/package-lock.json ./
|
|
RUN npm ci
|
|
COPY web/ ./
|
|
RUN npm run build
|
|
|
|
# Stage 2: Runtime
|
|
FROM alpine:3.21
|
|
RUN apk add --no-cache ca-certificates curl bash
|
|
RUN curl -LsSf https://astral.sh/uv/install.sh | sh
|
|
ENV PATH="/root/.local/bin:$PATH"
|
|
RUN uv venv /app/venv && uv pip install --python /app/venv/bin/python sentence-transformers
|
|
RUN /app/venv/bin/python -c "from sentence_transformers import SentenceTransformer; SentenceTransformer('all-MiniLM-L6-v2')"
|
|
RUN mkdir -p /app/data/workspaces
|
|
WORKDIR /app
|
|
COPY target/aarch64-unknown-linux-musl/release/tori .
|
|
COPY --from=frontend /app/web/dist ./web/dist/
|
|
COPY scripts/embed.py ./scripts/
|
|
COPY config.yaml .
|
|
|
|
EXPOSE 3000
|
|
CMD ["./tori"]
|