Spaces:
Sleeping
Sleeping
Upload dockerfile_gradio.txt
Browse files- dockerfile_gradio.txt +25 -0
dockerfile_gradio.txt
ADDED
|
@@ -0,0 +1,25 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
FROM python:3.10-slim
|
| 2 |
+
|
| 3 |
+
WORKDIR /app
|
| 4 |
+
|
| 5 |
+
# Install system dependencies
|
| 6 |
+
RUN apt-get update && apt-get install -y \
|
| 7 |
+
build-essential \
|
| 8 |
+
git \
|
| 9 |
+
&& rm -rf /var/lib/apt/lists/*
|
| 10 |
+
|
| 11 |
+
# Copy requirements first for better caching
|
| 12 |
+
COPY requirements.txt .
|
| 13 |
+
RUN pip install --no-cache-dir -r requirements.txt
|
| 14 |
+
|
| 15 |
+
# Copy the application code
|
| 16 |
+
COPY app.py .
|
| 17 |
+
|
| 18 |
+
# Expose port 7860 for Gradio
|
| 19 |
+
EXPOSE 7860
|
| 20 |
+
|
| 21 |
+
# Set up a volume for model caching
|
| 22 |
+
VOLUME /root/.cache/huggingface
|
| 23 |
+
|
| 24 |
+
# Command to run the application
|
| 25 |
+
CMD ["python", "app.py"]
|