File size: 974 Bytes
89c519e
8d4bbca
89c519e
 
 
 
41398a5
89c519e
 
 
 
 
41398a5
 
80e3f9f
89c519e
 
 
41398a5
89c519e
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
# Use a lightweight Python base
FROM python:3.9-slim
# Set working directory
WORKDIR /app

# 1. Install System Dependencies
# We need 'wget' to download unrar
RUN apt-get update && apt-get install -y \
    wget \
    && rm -rf /var/lib/apt/lists/*

# 2. Install Official Unrar (Required for rarfile library to work correctly)
# Downloading 'rarlinux-x64.tar.gz' ensures we get the latest version and avoids 404 errors on old versions
RUN wget https://www.rarlab.com/rar/rarlinux-x64-720b3.tar.gz && \
    tar -zxvf rarlinux-x64-720b3.tar.gz && \
    cp rar/unrar /usr/bin/unrar && \
    cp rar/rar /usr/bin/rar && \
    chmod 755 /usr/bin/unrar && \
    rm -rf rar rarlinux-x64-720b3.tar.gz

# 3. Copy Requirements
COPY requirements.txt .

# 4. Install Python Dependencies
RUN pip install --no-cache-dir -r requirements.txt

# 5. Copy Application Code
COPY . .

# 6. Expose Port
EXPOSE 8000

# 7. Run Uvicorn
CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]