melodix-api / Dockerfile
Isaac105's picture
deploy from github actions
e38aacf
Raw History Blame Contribute Delete
1.13 kB
FROM python:3.10-slim
# Install system dependencies
RUN apt-get update && apt-get install -y \
curl \
ffmpeg \
git \
build-essential \
&& rm -rf /var/lib/apt/lists/*
WORKDIR /code
# Copy requirements and install python packages
COPY ./requirements.txt /code/requirements.txt
RUN pip install --upgrade pip "setuptools<70" wheel && \
pip install "cython<3.0" "numpy>=1.26.3,<2.0" && \
pip install --no-build-isolation madmom && \
pip install --no-cache-dir --upgrade -r /code/requirements.txt
# Pre-descargar pesos del modelo BTC de acordes en la imagen
RUN mkdir -p /code/models && \
curl -L -o /code/models/btc_chord.pth https://huggingface.co/amaai-lab/music2emo/resolve/main/inference/data/btc_model.pt
# Copy application files
COPY . .
# Create writable folders with permissions for Hugging Face user 1000
RUN mkdir -p /code/processed /code/uploads /code/logs /code/models && chmod -R 777 /code
# Grant execution rights to start script (and strip any Windows carriage returns)
RUN sed -i 's/\r$//' /code/start.sh && chmod +x /code/start.sh
# Run start script
CMD ["/code/start.sh"]