File size: 978 Bytes
d4afb7f
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
FROM python:3.8-slim

WORKDIR /app

# Install system dependencies
COPY packages.txt /app/packages.txt
RUN apt-get update && \
    xargs apt-get install -y --no-install-recommends < /app/packages.txt && \
    rm -rf /var/lib/apt/lists/*

# Install Python dependencies
COPY requirements.txt /app/requirements.txt
ENV PIP_NO_BUILD_ISOLATION=1
RUN pip install --no-cache-dir -U pip wheel Cython
RUN pip install --no-cache-dir setuptools==59.8.0
RUN pip install --no-cache-dir numpy==1.23.5
RUN pip install --no-cache-dir -r /app/requirements.txt
RUN pip install --no-cache-dir --no-build-isolation madmom

# Apply madmom patch
COPY patch_madmom.py /app/patch_madmom.py
RUN python /app/patch_madmom.py
RUN python -c "import madmom; print('madmom import OK')"

# Copy the rest of the app
COPY . /app

# Set working directory to chord recognition repo so model files are found
WORKDIR /app/ChordRecognitionMIDITrainedExtractor

ENV PORT=7860
EXPOSE 7860

CMD ["python", "/app/app.py"]