trainSpace / Dockerfile
pathii's picture
Update Dockerfile
af8234c verified
raw
history blame
1.43 kB
FROM python:3.8-bullseye # Using full Debian image for better compatibility
# Set up environment
ENV PYTHONUNBUFFERED=1 \
DEBIAN_FRONTEND=noninteractive \
PIP_NO_CACHE_DIR=1 \
PIP_DISABLE_PIP_VERSION_CHECK=1
# Install system dependencies - expanded set
RUN apt-get update && apt-get install -y --no-install-recommends \
build-essential \
cmake \
git \
curl \
wget \
libopenblas-dev \
libssl-dev \
zlib1g-dev \
libbz2-dev \
libreadline-dev \
libsqlite3-dev \
llvm \
libncurses5-dev \
libncursesw5-dev \
xz-utils \
tk-dev \
libffi-dev \
liblzma-dev \
&& rm -rf /var/lib/apt/lists/*
# Install Python packages with precise order and fallbacks
COPY requirements.txt .
RUN pip install --upgrade pip setuptools wheel && \
pip install torch==2.2.1 --index-url https://download.pytorch.org/whl/cpu && \
pip install ninja==1.11.1 && \
pip install transformers==4.38.2 && \
pip install accelerate==0.27.2 && \
pip install datasets==2.18.0 && \
pip install huggingface_hub==0.20.3 && \
{ pip install deepspeed==0.13.1 || pip install deepspeed==0.13.1 --no-deps; } && \
pip install unsloth==0.2.0 && \
{ pip install vllm==0.3.0 || pip install vllm==0.3.0 --no-deps; } && \
pip install fastapi==0.109.1 uvicorn==0.27.0
WORKDIR /app
COPY . /app
RUN mkdir -p /app/checkpoints /app/logs
CMD ["python", "train.py"]