ThomasBlumet
commited on
Commit
·
5b8c5fb
1
Parent(s):
9e3919d
update adding a venv
Browse files- Dockerfile +9 -4
Dockerfile
CHANGED
@@ -5,16 +5,21 @@ FROM nvidia/cuda:12.6.3-cudnn-devel-ubuntu24.04
|
|
5 |
#ENV DEBIAN_FRONTEND=noninteractive
|
6 |
|
7 |
# Install Python and pip
|
8 |
-
RUN apt-get update && apt-get install -y python3-pip
|
9 |
|
10 |
# Where we'll copy the code
|
11 |
WORKDIR /code
|
12 |
|
13 |
# Copy the current directory contents into the container at /code
|
14 |
COPY ./requirements.txt /code/requirements.txt
|
15 |
-
|
16 |
-
|
17 |
-
#RUN pip install
|
|
|
|
|
|
|
|
|
|
|
18 |
|
19 |
# Creates a non-root user with an explicit UID
|
20 |
# For more info, please refer to https://aka.ms/vscode-docker-python-configure-containers
|
|
|
5 |
#ENV DEBIAN_FRONTEND=noninteractive
|
6 |
|
7 |
# Install Python and pip
|
8 |
+
RUN apt-get update && apt-get install -y python3-pip python3-venv
|
9 |
|
10 |
# Where we'll copy the code
|
11 |
WORKDIR /code
|
12 |
|
13 |
# Copy the current directory contents into the container at /code
|
14 |
COPY ./requirements.txt /code/requirements.txt
|
15 |
+
|
16 |
+
# Install pip requirements without venv
|
17 |
+
#RUN pip install --no-cache-dir --upgrade -r /code/requirements.txt
|
18 |
+
|
19 |
+
# Create a virtual environment and install pip requirements
|
20 |
+
RUN python3 -m venv /code/venv
|
21 |
+
RUN /code/venv/bin/pip install --no-cache-dir --upgrade pip
|
22 |
+
RUN /code/venv/bin/pip install --no-cache-dir --upgrade -r /code/requirements.txt
|
23 |
|
24 |
# Creates a non-root user with an explicit UID
|
25 |
# For more info, please refer to https://aka.ms/vscode-docker-python-configure-containers
|