Fix build

This commit is contained in:
2025-11-27 17:43:52 +01:00
parent 95194eadfc
commit 679e179edc
13 changed files with 7645 additions and 23 deletions

View File

@@ -7,15 +7,25 @@ RUN apt-get update && apt-get install -y \
libsndfile1-dev \
gcc \
g++ \
gfortran \
libopenblas-dev \
liblapack-dev \
pkg-config \
curl \
&& rm -rf /var/lib/apt/lists/*
# Set working directory
WORKDIR /app
# Upgrade pip, setuptools, wheel
RUN pip install --no-cache-dir --upgrade pip setuptools wheel
# Copy requirements
COPY requirements.txt .
# Install Python dependencies
# Install Python dependencies in stages for better caching
RUN pip install --no-cache-dir numpy==1.24.3
RUN pip install --no-cache-dir scipy==1.11.4
RUN pip install --no-cache-dir -r requirements.txt
# Copy application code

View File

@@ -0,0 +1,35 @@
FROM python:3.11-slim
# Install system dependencies
RUN apt-get update && apt-get install -y \
ffmpeg \
libsndfile1 \
gcc \
g++ \
curl \
&& rm -rf /var/lib/apt/lists/*
# Set working directory
WORKDIR /app
# Upgrade pip
RUN pip install --no-cache-dir --upgrade pip setuptools wheel
# Copy minimal requirements
COPY requirements-minimal.txt .
# Install dependencies
RUN pip install --no-cache-dir -r requirements-minimal.txt
# Copy application code
COPY src/ ./src/
COPY alembic.ini .
# Create models directory
RUN mkdir -p /app/models
# Expose port
EXPOSE 8000
# Run server (skip migrations for now)
CMD uvicorn src.api.main:app --host 0.0.0.0 --port 8000

View File

@@ -0,0 +1,31 @@
# Minimal requirements (without Essentia for faster build)
# Web Framework
fastapi==0.109.0
uvicorn[standard]==0.27.0
python-multipart==0.0.6
# Database
sqlalchemy==2.0.25
psycopg2-binary==2.9.9
pgvector==0.2.4
alembic==1.13.1
# Audio Processing (without Essentia)
librosa==0.10.1
soundfile==0.12.1
audioread==3.0.1
mutagen==1.47.0
# Scientific Computing
numpy==1.24.3
scipy==1.11.4
# Configuration & Validation
pydantic==2.5.3
pydantic-settings==2.1.0
python-dotenv==1.0.0
# Utilities
aiofiles==23.2.1
httpx==0.26.0

View File

@@ -55,7 +55,7 @@ def create_track(db: Session, analysis: AudioAnalysis) -> AudioTrack:
vocal_gender=analysis.vocal_gender,
# Metadata
metadata=analysis.metadata,
extra_metadata=analysis.metadata,
)
db.add(track)

View File

@@ -60,7 +60,7 @@ class AudioTrack(Base):
embedding_model = Column(String, nullable=True) # Model name used
# Additional metadata (JSON for flexibility)
metadata = Column(JSON, nullable=True)
extra_metadata = Column(JSON, nullable=True)
# Indexes
__table_args__ = (
@@ -123,5 +123,5 @@ class AudioTrack(Base):
"dimension": 512 if self.embedding else None,
# Don't include actual vector in API responses (too large)
},
"metadata": self.metadata or {},
"metadata": self.extra_metadata or {},
}