Luigi commited on
Commit
7653a86
·
verified ·
1 Parent(s): 06ed160

Add a Dockerfile to customize pip timeout

Browse files
Files changed (1) hide show
  1. 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"]