# Use the NVIDIA CUDA base image | |
FROM nvidia/cuda:11.8.0-cudnn8-devel-ubuntu22.04 | |
# Set the working directory | |
WORKDIR /app | |
# Install Python and other necessary packages | |
RUN apt-get update && apt-get install -y \ | |
python3 \ | |
python3-pip \ | |
&& rm -rf /var/lib/apt/lists/* | |
# Copy the requirements file and install the Python dependencies | |
COPY requirements.txt . | |
RUN pip3 install --no-cache-dir -r requirements.txt | |
# Copy the rest of the application code | |
COPY . . | |
# Expose the port the app runs on | |
EXPOSE 7860 | |
# Command to run the application | |
CMD ["python3", "app.py"] | |