Spaces:
Runtime error
Runtime error
Add a Dockerfile to customize pip timeout
Browse files- Dockerfile +22 -0
Dockerfile
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Use a lightweight Python base image
|
| 2 |
+
FROM python:3.11-slim
|
| 3 |
+
|
| 4 |
+
# Set working directory
|
| 5 |
+
WORKDIR /app
|
| 6 |
+
|
| 7 |
+
# Copy requirements file and install Python dependencies with increased timeout
|
| 8 |
+
COPY requirements.txt .
|
| 9 |
+
RUN pip install --upgrade pip && pip install --timeout=7200 -r requirements.txt
|
| 10 |
+
|
| 11 |
+
# Copy packages.txt and install system dependencies
|
| 12 |
+
COPY packages.txt .
|
| 13 |
+
RUN apt-get update && xargs -a packages.txt apt-get install -y && rm -rf /var/lib/apt/lists/*
|
| 14 |
+
|
| 15 |
+
# Copy application code
|
| 16 |
+
COPY . .
|
| 17 |
+
|
| 18 |
+
# Set environment variables
|
| 19 |
+
ENV PYTHONUNBUFFERED=1
|
| 20 |
+
|
| 21 |
+
# Command to run your application
|
| 22 |
+
# CMD ["python", "app.py"]
|