Spaces:
Build error
Build error
Update Dockerfile
Browse files- Dockerfile +13 -7
Dockerfile
CHANGED
@@ -2,23 +2,29 @@ FROM python:3.8-slim
|
|
2 |
|
3 |
# Set environment variables
|
4 |
ENV PYTHONUNBUFFERED=1 \
|
5 |
-
DEBIAN_FRONTEND=noninteractive
|
|
|
|
|
6 |
|
7 |
-
# Install system dependencies
|
8 |
-
RUN apt-get update && apt-get install -y \
|
|
|
|
|
9 |
git \
|
10 |
curl \
|
|
|
11 |
&& rm -rf /var/lib/apt/lists/*
|
12 |
|
13 |
-
# Install Python dependencies
|
14 |
COPY requirements.txt .
|
15 |
-
RUN pip install --
|
16 |
-
pip install --
|
|
|
17 |
|
18 |
WORKDIR /app
|
19 |
COPY . /app
|
20 |
|
21 |
-
# Pre-create directories
|
22 |
RUN mkdir -p /app/checkpoints /app/logs
|
23 |
|
24 |
CMD ["python", "train.py"]
|
|
|
2 |
|
3 |
# Set environment variables
|
4 |
ENV PYTHONUNBUFFERED=1 \
|
5 |
+
DEBIAN_FRONTEND=noninteractive \
|
6 |
+
PIP_NO_CACHE_DIR=1 \
|
7 |
+
PIP_DISABLE_PIP_VERSION_CHECK=1
|
8 |
|
9 |
+
# Install system dependencies first
|
10 |
+
RUN apt-get update && apt-get install -y --no-install-recommends \
|
11 |
+
build-essential \
|
12 |
+
libopenblas-dev \
|
13 |
git \
|
14 |
curl \
|
15 |
+
cmake \
|
16 |
&& rm -rf /var/lib/apt/lists/*
|
17 |
|
18 |
+
# Install Python dependencies in two stages
|
19 |
COPY requirements.txt .
|
20 |
+
RUN pip install --upgrade pip setuptools wheel && \
|
21 |
+
pip install torch --index-url https://download.pytorch.org/whl/cpu && \
|
22 |
+
pip install -r requirements.txt
|
23 |
|
24 |
WORKDIR /app
|
25 |
COPY . /app
|
26 |
|
27 |
+
# Pre-create directories
|
28 |
RUN mkdir -p /app/checkpoints /app/logs
|
29 |
|
30 |
CMD ["python", "train.py"]
|