Spaces:
Running
Running
Update Dockerfile
Browse files- Dockerfile +26 -13
Dockerfile
CHANGED
|
@@ -1,22 +1,35 @@
|
|
| 1 |
-
# Use
|
| 2 |
FROM python:3.10-slim
|
| 3 |
|
| 4 |
-
#
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 5 |
WORKDIR /app
|
| 6 |
|
| 7 |
-
#
|
| 8 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 9 |
|
| 10 |
-
# Install
|
| 11 |
RUN pip install --no-cache-dir -r requirements.txt
|
| 12 |
|
| 13 |
-
#
|
| 14 |
-
|
| 15 |
|
| 16 |
-
#
|
| 17 |
-
|
| 18 |
-
ENV FLASK_DEBUG=1
|
| 19 |
-
ENV FLASK_ENV=development
|
| 20 |
|
| 21 |
-
#
|
| 22 |
-
CMD ["
|
|
|
|
| 1 |
+
# Use a Python base image
|
| 2 |
FROM python:3.10-slim
|
| 3 |
|
| 4 |
+
# Install necessary system packages
|
| 5 |
+
RUN apt-get update && apt-get install -y \
|
| 6 |
+
git ffmpeg curl build-essential \
|
| 7 |
+
&& apt-get clean \
|
| 8 |
+
&& rm -rf /var/lib/apt/lists/*
|
| 9 |
+
|
| 10 |
+
# Set working directory
|
| 11 |
WORKDIR /app
|
| 12 |
|
| 13 |
+
# Create fallback cache directories
|
| 14 |
+
RUN mkdir -p /app/whisper_cache \
|
| 15 |
+
&& mkdir -p /tmp/.whisper_cache \
|
| 16 |
+
&& mkdir -p /app/whisper_models
|
| 17 |
+
|
| 18 |
+
# Set environment variables
|
| 19 |
+
ENV XDG_CACHE_HOME=/app/whisper_cache
|
| 20 |
+
ENV WHISPER_CACHE=/app/whisper_cache
|
| 21 |
+
|
| 22 |
+
# Copy your Python requirements
|
| 23 |
+
COPY requirements.txt .
|
| 24 |
|
| 25 |
+
# Install Python dependencies
|
| 26 |
RUN pip install --no-cache-dir -r requirements.txt
|
| 27 |
|
| 28 |
+
# Copy your app files
|
| 29 |
+
COPY . .
|
| 30 |
|
| 31 |
+
# Expose port if you're running a web app (like with Flask)
|
| 32 |
+
EXPOSE 7860
|
|
|
|
|
|
|
| 33 |
|
| 34 |
+
# Set the entrypoint command
|
| 35 |
+
CMD ["python", "main.py"]
|