generated from kyegomez/Python-Package-Template
-
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathDockerFile
29 lines (19 loc) · 797 Bytes
/
DockerFile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
# Use an official NVIDIA CUDA image as a base image
FROM nvidia/cuda:11.0-base-ubuntu20.04
# Install Python and pip
RUN apt-get update && apt-get install -y \
python3.8 \
python3-pip
# Set Python 3.8 as the default
RUN update-alternatives --install /usr/bin/python python /usr/bin/python3.8 1
RUN update-alternatives --install /usr/bin/pip pip /usr/bin/pip3 1
# Set the working directory in the container to /app
WORKDIR /app
# Copy the requirements.txt file into the container
COPY requirements.txt ./
# Install any needed packages specified in requirements.txt
RUN pip install --no-cache-dir -r requirements.txt
# Copy the rest of the code into the container
COPY . .
# Define the command to run your app using CMD which defines your runtime
CMD [ "python", "your_script.py" ]