Update Dockerfile
Browse files- Dockerfile +15 -26
Dockerfile
CHANGED
|
@@ -1,37 +1,26 @@
|
|
| 1 |
-
#
|
| 2 |
-
FROM python:3.
|
| 3 |
-
|
| 4 |
-
# Install system dependencies
|
| 5 |
-
RUN apt-get update && apt-get install -y \
|
| 6 |
-
git \
|
| 7 |
-
ffmpeg \
|
| 8 |
-
&& rm -rf /var/lib/apt/lists/*
|
| 9 |
|
| 10 |
# Set working directory
|
| 11 |
WORKDIR /app
|
| 12 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 13 |
# Copy requirements
|
| 14 |
COPY requirements.txt .
|
| 15 |
|
| 16 |
-
#
|
| 17 |
-
RUN pip install --no-cache-dir --upgrade pip setuptools wheel
|
| 18 |
RUN pip install --no-cache-dir -r requirements.txt
|
| 19 |
|
| 20 |
-
#
|
| 21 |
-
|
| 22 |
-
|
| 23 |
-
# Copy app code
|
| 24 |
-
COPY app.py .
|
| 25 |
-
|
| 26 |
-
# Set environment variables
|
| 27 |
-
ENV UPLOAD_DIR=/app/uploads
|
| 28 |
-
ENV CSV_DIR=/app/csv_files
|
| 29 |
-
ENV TRANSFORMERS_CACHE=/app/cache
|
| 30 |
-
ENV HF_HOME=/app/cache
|
| 31 |
-
ENV TORCH_HOME=/app/cache
|
| 32 |
|
| 33 |
-
# Expose port
|
| 34 |
-
EXPOSE
|
| 35 |
|
| 36 |
-
#
|
| 37 |
-
CMD ["uvicorn", "app:
|
|
|
|
| 1 |
+
# Use lightweight python base image
|
| 2 |
+
FROM python:3.10-slim
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 3 |
|
| 4 |
# Set working directory
|
| 5 |
WORKDIR /app
|
| 6 |
|
| 7 |
+
# Install system dependencies (for Whisper + Torch audio processing)
|
| 8 |
+
RUN apt-get update && apt-get install -y ffmpeg git && rm -rf /var/lib/apt/lists/*
|
| 9 |
+
|
| 10 |
+
# Upgrade pip
|
| 11 |
+
RUN pip install --upgrade pip
|
| 12 |
+
|
| 13 |
# Copy requirements
|
| 14 |
COPY requirements.txt .
|
| 15 |
|
| 16 |
+
# Install Python dependencies
|
|
|
|
| 17 |
RUN pip install --no-cache-dir -r requirements.txt
|
| 18 |
|
| 19 |
+
# Copy all project files
|
| 20 |
+
COPY . .
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 21 |
|
| 22 |
+
# Expose port (Hugging Face expects 7860 for Gradio or 8000 for FastAPI)
|
| 23 |
+
EXPOSE 7860
|
| 24 |
|
| 25 |
+
# Start FastAPI with Uvicorn (works in Hugging Face)
|
| 26 |
+
CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]
|