updated docker file
Browse files- Dockerfile +8 -6
Dockerfile
CHANGED
|
@@ -1,9 +1,10 @@
|
|
| 1 |
# Use a lightweight Python image
|
| 2 |
FROM python:3.11-slim
|
| 3 |
|
| 4 |
-
# Install ffmpeg (needed by yt-dlp)
|
| 5 |
RUN apt-get update && apt-get install -y \
|
| 6 |
ffmpeg \
|
|
|
|
| 7 |
&& rm -rf /var/lib/apt/lists/*
|
| 8 |
|
| 9 |
# Set working directory
|
|
@@ -19,9 +20,10 @@ RUN pip install --no-cache-dir -r requirements.txt
|
|
| 19 |
# Copy project files
|
| 20 |
COPY . .
|
| 21 |
|
| 22 |
-
# Expose the port
|
| 23 |
-
EXPOSE
|
| 24 |
|
| 25 |
-
# Start the Flask app using Gunicorn
|
| 26 |
-
#
|
| 27 |
-
|
|
|
|
|
|
| 1 |
# Use a lightweight Python image
|
| 2 |
FROM python:3.11-slim
|
| 3 |
|
| 4 |
+
# Install ffmpeg (needed by yt-dlp) and git
|
| 5 |
RUN apt-get update && apt-get install -y \
|
| 6 |
ffmpeg \
|
| 7 |
+
git \
|
| 8 |
&& rm -rf /var/lib/apt/lists/*
|
| 9 |
|
| 10 |
# Set working directory
|
|
|
|
| 20 |
# Copy project files
|
| 21 |
COPY . .
|
| 22 |
|
| 23 |
+
# Expose the port the app will run on. Hugging Face Spaces typically use 7860.
|
| 24 |
+
EXPOSE 7860
|
| 25 |
|
| 26 |
+
# Start the Flask app using Gunicorn.
|
| 27 |
+
# Hugging Face Spaces automatically sets the PORT environment variable.
|
| 28 |
+
# We bind to 0.0.0.0 and the port specified by the PORT env var, with a fallback to 7860.
|
| 29 |
+
CMD ["gunicorn", "--worker-class", "gevent", "--timeout", "3600", "--bind", "0.0.0.0:${PORT:-7860}", "app:app"]
|