- migration 00006: track features and embeddings (pgvector, HNSW), analysis queue filled by a trigger on new tracks, wave sessions and impressions, recommender profiles, model versions - analyzer basic-1 (ADR-014): ffmpeg decode, three 30 s excerpts, 256-d timbre/rhythm embedding, tempo by onset autocorrelation, key, loudness, energy, danceability, acousticness, intro length; worker with SKIP LOCKED claims, retries and re-analysis on version change - wave engine v1: candidates (session/taste similarity, fresh, liked artists, rediscover, popular, exploration, seed), filters (dislikes, played in 3 h, already served), heuristic score, activity and mood fit from contexts.yaml with relaxing thresholds, MMR with one track per artist, exploration share, session vector updated by reactions and a change of course after three skips - POST /internal/wave/batch with the catalog index cached in memory and the session kept in Redis Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
28 lines
1.1 KiB
Docker
28 lines
1.1 KiB
Docker
# syntax=docker/dockerfile:1
|
|
# Сборка из корня репозитория:
|
|
# docker build -f services/recommender/Dockerfile --build-arg VERSION=1.2.3 .
|
|
# Один образ — две роли: `serve` (recommender) и `analyze --workers N` (analyzer).
|
|
|
|
FROM ghcr.io/astral-sh/uv:0.10.2 AS uv
|
|
|
|
FROM python:3.12-slim AS build
|
|
COPY --from=uv /uv /usr/local/bin/uv
|
|
ENV UV_COMPILE_BYTECODE=1 UV_LINK_MODE=copy UV_PYTHON_DOWNLOADS=never
|
|
WORKDIR /app
|
|
COPY services/recommender/pyproject.toml services/recommender/uv.lock ./
|
|
RUN --mount=type=cache,target=/root/.cache/uv uv sync --frozen --no-dev --no-install-project
|
|
COPY services/recommender/ ./
|
|
RUN --mount=type=cache,target=/root/.cache/uv uv sync --frozen --no-dev
|
|
|
|
FROM python:3.12-slim
|
|
# ffmpeg декодирует аудио для анализатора.
|
|
RUN apt-get update && apt-get install -y --no-install-recommends ffmpeg && rm -rf /var/lib/apt/lists/* && useradd --system --uid 10001 pipu
|
|
COPY --from=build /app /app
|
|
ARG VERSION=0.0.0-dev
|
|
ENV PATH=/app/.venv/bin:$PATH PIPU_VERSION=${VERSION} PYTHONUNBUFFERED=1
|
|
USER pipu
|
|
WORKDIR /app
|
|
EXPOSE 8000
|
|
ENTRYPOINT ["pipu-rec"]
|
|
CMD ["serve"]
|