Spaces:
Sleeping
Sleeping
Create Dockerfile
Browse files- Dockerfile +35 -0
Dockerfile
ADDED
|
@@ -0,0 +1,35 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Use a lightweight Python base
|
| 2 |
+
FROM python:3.9-slim
|
| 3 |
+
|
| 4 |
+
# Set working directory
|
| 5 |
+
WORKDIR /app
|
| 6 |
+
|
| 7 |
+
# 1. Install System Dependencies
|
| 8 |
+
# We need 'wget' and 'make' to install unrar, or just wget to download precompiled
|
| 9 |
+
RUN apt-get update && apt-get install -y \
|
| 10 |
+
wget \
|
| 11 |
+
&& rm -rf /var/lib/apt/lists/*
|
| 12 |
+
|
| 13 |
+
# 2. Install Official Unrar (Required for rarfile library to work correctly)
|
| 14 |
+
# Downloading pre-compiled binary for Linux x64
|
| 15 |
+
RUN wget https://www.rarlab.com/rar/rarlinux-x64-6.2.3.tar.gz && \
|
| 16 |
+
tar -zxvf rarlinux-x64-6.2.3.tar.gz && \
|
| 17 |
+
cp rar/unrar /usr/bin/unrar && \
|
| 18 |
+
cp rar/rar /usr/bin/rar && \
|
| 19 |
+
chmod 755 /usr/bin/unrar && \
|
| 20 |
+
rm -rf rar rarlinux-x64-6.2.3.tar.gz
|
| 21 |
+
|
| 22 |
+
# 3. Copy Requirements
|
| 23 |
+
COPY requirements.txt .
|
| 24 |
+
|
| 25 |
+
# 4. Install Python Dependencies
|
| 26 |
+
RUN pip install --no-cache-dir -r requirements.txt
|
| 27 |
+
|
| 28 |
+
# 5. Copy Application Code
|
| 29 |
+
COPY . .
|
| 30 |
+
|
| 31 |
+
# 6. Expose Port
|
| 32 |
+
EXPOSE 8000
|
| 33 |
+
|
| 34 |
+
# 7. Run Uvicorn
|
| 35 |
+
CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]
|