From 47033edf88901a4a8a3f993ea77984a16fe42323 Mon Sep 17 00:00:00 2001 From: mbfannan <122257080+mbfannan@users.noreply.github.com> Date: Sun, 12 Nov 2023 18:10:34 +0300 Subject: [PATCH] Update Dockerfile Signed-off-by: mbfannan <122257080+mbfannan@users.noreply.github.com> --- Dockerfile | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/Dockerfile b/Dockerfile index 77d3ffbc..a3e20260 100644 --- a/Dockerfile +++ b/Dockerfile @@ -9,15 +9,22 @@ RUN mkdir -p /usr/src/app && \ chown -R node:node /usr/src/app WORKDIR /usr/src/app +# Create a Python virtual environment and activate it +RUN python3 -m venv venv +ENV PATH="/usr/src/app/venv/bin:$PATH" + +# Upgrade pip to the latest version +RUN pip install --upgrade pip + +# Copy your Python requirements file and install Python dependencies +COPY --chown=node:node career-model/requirements.txt . +RUN pip install --no-cache-dir -r requirements.txt + # Install Node.js dependencies COPY --chown=node:node package.json.docker /usr/src/app/package.json RUN npm install && \ npm cache clean --force -# Copy your Python requirements file and install Python dependencies -COPY --chown=node:node career-model/requirements.txt /usr/src/app/career-model/requirements.txt -RUN python3 -m pip install --no-cache-dir -r career-model/requirements.txt - # Copy the rest of your application's source code COPY --chown=node:node . /usr/src/app