NitinBot001 commited on
Commit
7bf005b
·
verified ·
1 Parent(s): da9fca6

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +18 -13
Dockerfile CHANGED
@@ -1,27 +1,32 @@
1
- # Use official Python image as base
2
  FROM python:3.11-slim
3
 
4
  # Set working directory
5
  WORKDIR /app
6
 
7
- # Set environment variables
8
- ENV PYTHONDONTWRITEBYTECODE 1
9
- ENV PYTHONUNBUFFERED 1
10
-
11
- # Install system dependencies
12
- RUN apt-get update && apt-get install -y --no-install-recommends \
13
- build-essential \
14
  && rm -rf /var/lib/apt/lists/*
15
 
16
- # Install Python dependencies
17
  COPY requirements.txt .
 
 
18
  RUN pip install --no-cache-dir -r requirements.txt
19
 
20
  # Copy application code
21
- COPY . .
 
 
 
22
 
23
- # Expose the port the app runs on
24
  EXPOSE 8000
25
 
26
- # Command to run the applicationp
27
- CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "8000"]
 
 
 
 
 
 
 
1
  FROM python:3.11-slim
2
 
3
  # Set working directory
4
  WORKDIR /app
5
 
6
+ # Install system dependencies (required for yt-dlp and ffmpeg)
7
+ RUN apt-get update && apt-get install -y \
8
+ ffmpeg \
 
 
 
 
9
  && rm -rf /var/lib/apt/lists/*
10
 
11
+ # Copy requirements first for better caching
12
  COPY requirements.txt .
13
+
14
+ # Install Python dependencies
15
  RUN pip install --no-cache-dir -r requirements.txt
16
 
17
  # Copy application code
18
+ COPY app.py .
19
+
20
+ # Create directory for cookies
21
+ RUN mkdir -p /app/cookies
22
 
23
+ # Expose port
24
  EXPOSE 8000
25
 
26
+ # Environment variables
27
+ ENV COOKIES_DIR=/app/cookies
28
+ ENV PORT=8000
29
+ ENV PYTHONUNBUFFERED=1
30
+
31
+ # Run with gunicorn for production
32
+ CMD ["gunicorn", "--bind", "0.0.0.0:8000", "--workers", "4", "--timeout", "120", "app:app"]