Spaces:
Paused
Paused
# Use the NVIDIA CUDA image as the base | |
FROM nvidia/cuda:12.3.2-cudnn9-devel-ubuntu22.04 | |
# Set the working directory | |
WORKDIR /home/user/app | |
# Install required system dependencies | |
RUN apt-get update && apt-get install -y \ | |
git rsync \ | |
make build-essential libssl-dev zlib1g-dev \ | |
libbz2-dev libreadline-dev libsqlite3-dev wget curl llvm \ | |
libncursesw5-dev xz-utils tk-dev libxml2-dev libxmlsec1-dev libffi-dev liblzma-dev \ | |
git-lfs ffmpeg libsm6 libxext6 cmake libgl1-mesa-glx \ | |
&& rm -rf /var/lib/apt/lists/* \ | |
&& git lfs install | |
# Install Python and pip | |
RUN curl https://pyenv.run | bash | |
# Set up pyenv environment | |
ENV PATH="/root/.pyenv/shims:/root/.pyenv/bin:/root/.pyenv/versions/3.9.6/bin:${PATH}" | |
RUN pyenv install 3.9.6 && pyenv global 3.9.6 | |
# Copy the requirements.txt file | |
COPY requirements.txt /tmp/requirements.txt | |
# Install Python packages | |
RUN --mount=type=cache,target=/root/.cache/pip \ | |
pip install --upgrade pip && \ | |
pip install --no-cache-dir -r /tmp/requirements.txt | |
# Copy application files | |
COPY . /home/user/app | |
# Copy the entrypoint script | |
COPY entrypoint.sh /entrypoint.sh | |
RUN chmod +x /entrypoint.sh | |
# Set the entrypoint script | |
ENTRYPOINT ["/entrypoint.sh"] | |