Update Dockerfile
Browse files- Dockerfile +17 -8
Dockerfile
CHANGED
|
@@ -4,25 +4,34 @@ FROM python:3.10-slim
|
|
| 4 |
# Prevents Python from writing pyc files to disk and buffers logs immediately
|
| 5 |
ENV PYTHONDONTWRITEBYTECODE=1
|
| 6 |
ENV PYTHONUNBUFFERED=1
|
| 7 |
-
|
|
|
|
| 8 |
ENV TRANSFORMERS_CACHE=/tmp/huggingface
|
| 9 |
|
| 10 |
-
# Set working directory
|
| 11 |
WORKDIR /app
|
| 12 |
|
| 13 |
-
# Install system dependencies
|
| 14 |
-
RUN apt-get update && apt-get install -y
|
| 15 |
-
|
| 16 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 17 |
COPY requirements.txt .
|
| 18 |
|
| 19 |
# Install Python dependencies
|
| 20 |
RUN pip install --upgrade pip && pip install --no-cache-dir -r requirements.txt
|
| 21 |
|
| 22 |
-
# Copy the rest of the
|
| 23 |
COPY . .
|
| 24 |
|
| 25 |
-
# Expose
|
| 26 |
EXPOSE 8000
|
| 27 |
|
| 28 |
# Run the app using Uvicorn
|
|
|
|
| 4 |
# Prevents Python from writing pyc files to disk and buffers logs immediately
|
| 5 |
ENV PYTHONDONTWRITEBYTECODE=1
|
| 6 |
ENV PYTHONUNBUFFERED=1
|
| 7 |
+
|
| 8 |
+
# Hugging Face cache directory
|
| 9 |
ENV TRANSFORMERS_CACHE=/tmp/huggingface
|
| 10 |
|
| 11 |
+
# Set working directory
|
| 12 |
WORKDIR /app
|
| 13 |
|
| 14 |
+
# Install system dependencies for audio and building Python packages
|
| 15 |
+
RUN apt-get update && apt-get install -y \
|
| 16 |
+
gcc \
|
| 17 |
+
g++ \
|
| 18 |
+
make \
|
| 19 |
+
python3-dev \
|
| 20 |
+
portaudio19-dev \
|
| 21 |
+
ffmpeg \
|
| 22 |
+
libsndfile1 \
|
| 23 |
+
&& rm -rf /var/lib/apt/lists/*
|
| 24 |
+
|
| 25 |
+
# Copy requirements first to leverage Docker cache
|
| 26 |
COPY requirements.txt .
|
| 27 |
|
| 28 |
# Install Python dependencies
|
| 29 |
RUN pip install --upgrade pip && pip install --no-cache-dir -r requirements.txt
|
| 30 |
|
| 31 |
+
# Copy the rest of the application code
|
| 32 |
COPY . .
|
| 33 |
|
| 34 |
+
# Expose FastAPI port
|
| 35 |
EXPOSE 8000
|
| 36 |
|
| 37 |
# Run the app using Uvicorn
|