Spaces:
Build error
Build error
# Stage 1: Builder | |
FROM python:3.8-bullseye as builder | |
RUN apt-get update && apt-get install -y --no-install-recommends \ | |
build-essential cmake git curl wget \ | |
&& rm -rf /var/lib/apt/lists/* | |
COPY requirements.txt . | |
RUN pip install --user --upgrade pip setuptools wheel && \ | |
pip install --user torch==2.2.1 --index-url https://download.pytorch.org/whl/cpu | |
# Stage 2: Runtime | |
FROM python:3.8-slim | |
COPY --from=builder /root/.local /root/.local | |
ENV PATH=/root/.local/bin:$PATH | |
COPY requirements.txt . | |
RUN pip install --no-cache-dir -r requirements.txt \ | |
&& find /root/.local -type d -name tests -exec rm -rf {} + | |
WORKDIR /app | |
COPY . /app | |
CMD ["python", "train.py"] |