forked from Lex-au/Orpheus-FastAPI
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile.runpod
More file actions
42 lines (33 loc) · 1.27 KB
/
Dockerfile.runpod
File metadata and controls
42 lines (33 loc) · 1.27 KB
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
36
37
38
39
40
41
42
# Use a RunPod base image with PyTorch and CUDA
FROM runpod/pytorch:2.1.0-py3.10-cuda11.8.0-devel
# Set non-interactive frontend
ENV DEBIAN_FRONTEND=noninteractive
# Install system dependencies required by Orpheus-FastAPI
# Update package lists first
RUN apt-get update && \
apt-get install -y --no-install-recommends \
libsndfile1 \
ffmpeg \
portaudio19-dev \
&& apt-get clean && \
rm -rf /var/lib/apt/lists/*
# Set up the working directory
WORKDIR /app
# Copy only the requirements file first to leverage Docker cache
COPY requirements.txt ./
# Install Python dependencies
# Using RUNPOD_PYTORCH=1 prevents reinstalling torch included in the base image
# Ensure pip is up-to-date and install requirements
RUN export RUNPOD_PYTORCH=1 && \
python -m pip install --upgrade pip && \
pip install --no-cache-dir -r requirements.txt
# Copy the rest of the application code
COPY . .
# Set environment variables (optional, can also be set in runpod.toml)
ENV PYTHONUNBUFFERED=1 \
PYTHONPATH=/app
# Port exposure and command are handled by runpod.toml OR the handler script itself
# EXPOSE 5005
# CMD is defined in runpod.toml runtime.command
# When using runpod.serverless.start, the script itself becomes the entrypoint.
CMD ["python", "-u", "src/handler.py"]