File size: 1,155 Bytes
df3ad52
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
# Use an official Python runtime as a parent image
FROM python:3.12-slim

# Set the working directory in the container to /app
WORKDIR /app

# Install system dependencies
RUN apt-get update && apt-get install -y --no-install-recommends \
    ffmpeg \
    curl \
    && rm -rf /var/lib/apt/lists/*

# Create bin directory and download mp4decrypt
RUN mkdir -p /app/bin && \
    curl -o /app/bin/mp4decrypt https://raw.githubusercontent.com/shubhamakshit/pwdlv3_assets/main/GNU/Linux/x86_64/mp4decrypt && \
    chmod +x /app/bin/mp4decrypt

# Add /app/bin to PATH
ENV PATH="/app/bin:$PATH"

# Copy requirements first for better caching
COPY requirements.txt .

# Install Python dependencies including gunicorn
RUN pip install --no-cache-dir -r requirements.txt && \
    pip install --no-cache-dir gunicorn

# Copy the rest of the application
COPY . .

# Make sure /app is writable (after copying files)
RUN chmod -R 777 /app && \
    mkdir -p /app/webdl && \
    chmod 777 /app/webdl

# Expose port 7860 for HuggingFace Spaces
EXPOSE 7860

# Run the application with gunicorn
CMD ["gunicorn", "--bind", "0.0.0.0:7860","--timeout", "120", "beta.api.api:app"]