FROM python:3.12-slim # System deps for your libraries + building C extensions RUN apt-get update && apt-get install -y --no-install-recommends \ build-essential \ ffmpeg \ libsndfile1 \ mecab \ libmecab2 \ mecab-ipadic-utf8 \ && rm -rf /var/lib/apt/lists/* WORKDIR /app # 1) Install Python deps from requirements COPY requirements.txt . RUN pip install --no-cache-dir -r requirements.txt # 2) Install Cython so we can compile the extension RUN pip install --no-cache-dir "Cython>=3.0.0" # 3) Copy the rest of the project COPY . . # 4) Build the local monotonic_align extension *in place* # This will create a linux/arm64 + CPython 3.12 .so under monotonic_align/monotonic_align/ RUN cd monotonic_align && python setup.py build_ext --inplace # Optional: reduce CPU thread explosion from numpy/torch ENV OMP_NUM_THREADS=4 EXPOSE 18343 ENV PORT=18343 CMD ["python", "app.py"]