Add server deployment support with Essentia

- Add install-server.sh for easy deployment on Linux servers
- Update Dockerfile to auto-detect architecture (x86_64/ARM64)
- Add deploy.sh for remote deployment
- Update requirements.txt with Essentia support notes

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
2025-12-02 23:04:29 +01:00
parent 063d43fcdf
commit e863f61103
5 changed files with 274 additions and 6 deletions

View File

@@ -26,6 +26,23 @@ COPY requirements.txt .
# 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
# Install Essentia - detect architecture and install appropriate wheel
RUN ARCH=$(uname -m) && \
if [ "$ARCH" = "x86_64" ]; then \
echo "Installing Essentia for x86_64..." && \
pip install --no-cache-dir --trusted-host essentia.upf.edu \
https://essentia.upf.edu/python-wheels/essentia-2.1_beta6.dev374-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl || \
echo "Essentia installation failed, using fallback mode"; \
elif [ "$ARCH" = "aarch64" ]; then \
echo "Installing Essentia for aarch64..." && \
pip install --no-cache-dir --trusted-host essentia.upf.edu \
https://essentia.upf.edu/python-wheels/essentia-2.1_beta6.dev374-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl || \
echo "Essentia installation failed, using fallback mode"; \
else \
echo "Unsupported architecture: $ARCH, using fallback mode"; \
fi
RUN pip install --no-cache-dir -r requirements.txt
# Copy application code

View File

@@ -15,12 +15,8 @@ soundfile==0.12.1
audioread==3.0.1
mutagen==1.47.0
# Optional: Essentia for genre/mood/instrument classification
# Note: essentia-tensorflow not available on PyPI for all platforms
# Uncomment if you can install it (Linux x86_64 only):
# essentia==2.1b6.dev1110
# For manual installation: pip install essentia
# Or build from source: https://github.com/MTG/essentia
# Essentia for genre/mood/instrument classification
# Note: Essentia is installed separately in Dockerfile from official wheels
# Scientific Computing
numpy==1.24.3

View File

@@ -0,0 +1,37 @@
"""Rename metadata to extra_metadata
Revision ID: 002
Revises: 001
Create Date: 2025-11-27
"""
from typing import Sequence, Union
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision: str = '002'
down_revision: Union[str, None] = '001'
branch_labels: Union[str, Sequence[str], None] = None
depends_on: Union[str, Sequence[str], None] = None
def upgrade() -> None:
# Check if column exists before renaming
op.execute("""
DO $$
BEGIN
IF EXISTS (
SELECT 1 FROM information_schema.columns
WHERE table_name='audio_tracks' AND column_name='metadata'
) THEN
ALTER TABLE audio_tracks RENAME COLUMN metadata TO extra_metadata;
END IF;
END $$;
""")
def downgrade() -> None:
# Rename back to metadata
op.execute('ALTER TABLE audio_tracks RENAME COLUMN extra_metadata TO metadata')