2024-06-15 18:31:53 +00:00
|
|
|
# Use the specified CUDA image as the base image
|
|
|
|
FROM nvidia/cuda:12.0.0-cudnn8-devel-ubuntu20.04
|
|
|
|
|
|
|
|
# Set environment variables to avoid interactive prompts during package installation
|
|
|
|
ENV DEBIAN_FRONTEND=noninteractive
|
|
|
|
|
2024-06-15 18:59:00 +00:00
|
|
|
# Change the APT package server (fix "Hash Sum Mismatch" problem)
|
2024-06-15 18:31:53 +00:00
|
|
|
RUN sed -i 's/archive.ubuntu.com/repo.catswords.com/g' /etc/apt/sources.list
|
|
|
|
RUN sed -i 's/security.ubuntu.com/repo.catswords.com/g' /etc/apt/sources.list
|
|
|
|
|
|
|
|
# Update the package list and install Python 3 and necessary packages
|
|
|
|
RUN apt-get update && \
|
|
|
|
apt-get install -y python3 python3-pip python3-dev && \
|
|
|
|
apt-get clean && \
|
|
|
|
rm -rf /var/lib/apt/lists/*
|
|
|
|
|
|
|
|
# Set Python 3 as the default python
|
|
|
|
RUN update-alternatives --install /usr/bin/python python /usr/bin/python3 1
|
|
|
|
|
|
|
|
# Create a working directory
|
|
|
|
WORKDIR /app
|
|
|
|
|
|
|
|
# Copy the requirements.txt file and install Python packages if available
|
|
|
|
COPY requirements.txt ./
|
|
|
|
RUN pip3 install --no-cache-dir -r requirements.txt
|
|
|
|
|
|
|
|
# Command to run the application (update this as needed)
|
|
|
|
CMD ["tail", "-f", "/dev/null"]
|