Add Dockerfile
This commit is contained in:
parent
26a0ea81c0
commit
bbb1d210aa
28
Dockerfile
Normal file
28
Dockerfile
Normal file
|
@ -0,0 +1,28 @@
|
|||
# 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
|
||||
|
||||
# Change the APT package server (fix HashSum issue)
|
||||
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"]
|
Loading…
Reference in New Issue
Block a user