Spaces:
Sleeping
Sleeping
Update Dockerfile
Browse files- Dockerfile +21 -7
Dockerfile
CHANGED
@@ -1,13 +1,27 @@
|
|
1 |
FROM python:3.10-slim
|
2 |
|
3 |
-
#
|
4 |
-
RUN apt-get update && apt-get install -y
|
|
|
|
|
5 |
|
6 |
-
#
|
7 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
8 |
RUN pip install --no-cache-dir -r requirements.txt
|
9 |
|
10 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
11 |
|
12 |
-
# Run Flask app
|
13 |
-
CMD ["python", "app.py"]
|
|
|
1 |
FROM python:3.10-slim
|
2 |
|
3 |
+
# System deps: ffmpeg is required for audio extraction
|
4 |
+
RUN apt-get update && apt-get install -y --no-install-recommends \
|
5 |
+
ffmpeg git && \
|
6 |
+
rm -rf /var/lib/apt/lists/*
|
7 |
|
8 |
+
# Caches go to /tmp (writable in Spaces)
|
9 |
+
ENV HF_HOME=/tmp/huggingface
|
10 |
+
ENV XDG_CACHE_HOME=/tmp
|
11 |
+
|
12 |
+
# Workdir
|
13 |
+
WORKDIR /app
|
14 |
+
|
15 |
+
# Python deps
|
16 |
+
COPY requirements.txt .
|
17 |
RUN pip install --no-cache-dir -r requirements.txt
|
18 |
|
19 |
+
# App code
|
20 |
+
COPY app.py .
|
21 |
+
|
22 |
+
# Expose the port Spaces expects
|
23 |
+
ENV PORT=7860
|
24 |
+
|
25 |
+
# Start FastAPI with uvicorn
|
26 |
+
CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]
|
27 |
|
|
|
|