| FROM ubuntu:22.04 |
|
|
| ENV DEBIAN_FRONTEND=noninteractive |
| ENV PYTHONUNBUFFERED=1 |
|
|
| |
| RUN apt-get update && apt-get install -y \ |
| python3.10 \ |
| python3.10-dev \ |
| python3-pip \ |
| git \ |
| ffmpeg \ |
| pkg-config \ |
| libgl1 \ |
| libglib2.0-0 \ |
| libavcodec-dev \ |
| libavformat-dev \ |
| libavdevice-dev \ |
| libavfilter-dev \ |
| libavutil-dev \ |
| libswscale-dev \ |
| libswresample-dev \ |
| && rm -rf /var/lib/apt/lists/* |
|
|
| |
| RUN ln -s /usr/bin/python3.10 /usr/bin/python |
|
|
| |
| RUN useradd -m -u 1000 user |
| USER user |
| ENV PATH=/home/user/.local/bin:$PATH |
| WORKDIR /app |
|
|
| |
| RUN pip install --upgrade pip setuptools wheel |
|
|
| |
| RUN pip install \ |
| torch==2.1.0+cpu \ |
| torchaudio==2.1.0+cpu \ |
| --index-url https://download.pytorch.org/whl/cpu |
|
|
| |
| RUN pip install \ |
| git+https://github.com/facebookresearch/audiocraft.git@v1.3.0 |
|
|
| |
| COPY --chown=user requirements.txt . |
| RUN pip install --no-cache-dir -r requirements.txt |
|
|
| |
| COPY --chown=user . /app |
|
|
| CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"] |
|
|