Update Dockerfile
Browse files- Dockerfile +11 -10
Dockerfile
CHANGED
|
@@ -1,24 +1,25 @@
|
|
| 1 |
FROM python:3.11-slim
|
| 2 |
|
| 3 |
-
# Create
|
| 4 |
RUN useradd -m -u 1000 user
|
| 5 |
|
| 6 |
WORKDIR /app
|
| 7 |
|
| 8 |
-
# Install system
|
| 9 |
RUN apt-get update && apt-get install -y \
|
| 10 |
-
gcc \
|
| 11 |
-
g++ \
|
| 12 |
-
curl \
|
| 13 |
-
rustc \
|
| 14 |
-
cargo \
|
| 15 |
&& rm -rf /var/lib/apt/lists/*
|
| 16 |
|
| 17 |
-
# Copy
|
| 18 |
COPY requirements.txt .
|
| 19 |
-
RUN pip install --no-cache-dir -r requirements.txt
|
| 20 |
|
| 21 |
-
#
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 22 |
COPY --chown=user:user . .
|
| 23 |
|
| 24 |
USER user
|
|
|
|
| 1 |
FROM python:3.11-slim
|
| 2 |
|
| 3 |
+
# Create user
|
| 4 |
RUN useradd -m -u 1000 user
|
| 5 |
|
| 6 |
WORKDIR /app
|
| 7 |
|
| 8 |
+
# Install system deps + Rust (for jiter) in one layer
|
| 9 |
RUN apt-get update && apt-get install -y \
|
| 10 |
+
gcc g++ curl rustc cargo \
|
|
|
|
|
|
|
|
|
|
|
|
|
| 11 |
&& rm -rf /var/lib/apt/lists/*
|
| 12 |
|
| 13 |
+
# Copy requirements first (better caching)
|
| 14 |
COPY requirements.txt .
|
|
|
|
| 15 |
|
| 16 |
+
# Install Python packages with retries and longer timeout
|
| 17 |
+
RUN pip install --no-cache-dir \
|
| 18 |
+
--timeout=120 \
|
| 19 |
+
--retries=5 \
|
| 20 |
+
-r requirements.txt
|
| 21 |
+
|
| 22 |
+
# Copy code
|
| 23 |
COPY --chown=user:user . .
|
| 24 |
|
| 25 |
USER user
|