Last active
March 27, 2024 13:02
-
-
Save Akashdesarda/f846297b68b80e641d34314010d2002b to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FROM nvidia/cuda:10.1-cudnn7-runtime | |
RUN apt update && \ | |
apt install --no-install-recommends -y build-essential software-properties-common && \ | |
add-apt-repository -y ppa:deadsnakes/ppa && \ | |
apt install --no-install-recommends -y python3.8 python3-pip python3-setuptools python3-distutils && \ | |
apt clean && rm -rf /var/lib/apt/lists/* | |
COPY req.txt /req.txt | |
COPY ./src /src | |
RUN python3.8 -m pip install --upgrade pip && \ | |
python3.8 -m pip install --no-cache-dir -r /req.txt | |
CMD ['python3', '/src/app.py'] | |
EXPOSE 8080 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
`FROM nvidia/cuda:10.1-cudnn7-runtime
RUN apt update &&
apt install --no-install-recommends -y build-essential software-properties-common &&
add-apt-repository -y ppa:deadsnakes/ppa &&
apt install --no-install-recommends -y python3.8 python3-pip python3-setuptools python3-distutils &&
apt clean && rm -rf /var/lib/apt/lists/*
COPY req.txt /req.txt
RUN python3.8 -m pip install --upgrade pip &&
python3.8 -m pip install --no-cache-dir -r /req.txt
COPY ./src /src
CMD ['python3', '/src/app.py']
EXPOSE 8080`
This way is better because if the req.txt stays the same, the build command will not run the installation if there is no change in the req