devusman commited on
Commit
00866c1
·
1 Parent(s): c4278f8

updated docker file

Browse files
Files changed (1) hide show
  1. 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 Gunicorn will run on. Render's default is 10000.
23
- EXPOSE 10000
24
 
25
- # Start the Flask app using Gunicorn with the gevent worker and a longer timeout
26
- # This prevents the worker from timing out during long downloads.
27
- CMD ["gunicorn", "--worker-class", "gevent", "--timeout", "3600", "--bind", "0.0.0.0:10000", "app:app"]
 
 
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"]