Spaces:
Runtime error
Runtime error
# Use an NVIDIA CUDA runtime as the base image for GPU support | |
FROM nvidia/cuda:12.1.1-devel-ubuntu22.04 | |
# Avoid prompts during package installation | |
ENV DEBIAN_FRONTEND=noninteractive | |
# Install system dependencies: Python, pip, git, and git-lfs | |
RUN apt-get update && \ | |
apt-get install -y python3.11 python3-pip git git-lfs && \ | |
rm -rf /var/lib/apt/lists/* | |
# Set the working directory | |
WORKDIR /code | |
# Install the correct GPU-enabled PyTorch version for CUDA 12.1 | |
RUN pip3 install torch==2.2.1 torchvision==0.17.1 torchaudio==2.2.1 --index-url https://download.pytorch.org/whl/cu121 | |
# Copy your cleaned requirements file | |
COPY requirements.txt requirements.txt | |
# Install all other Python dependencies | |
RUN pip3 install --no-cache-dir -r requirements.txt | |
# Copy the rest of your application code | |
COPY . . | |
# Make the start script executable | |
RUN chmod +x ./start.sh | |
# Run start.sh when the container launches | |
CMD ["/bin/bash", "./start.sh"] |