venv and pip install in dockerfile

This commit is contained in:
Dobromir Popov
2023-12-19 20:44:51 +00:00
parent 2a947d6c7c
commit b27700ae5c
6 changed files with 103 additions and 22 deletions

View File

@ -62,6 +62,7 @@ ENV NODE_ENV=demo
RUN apk update && apk add git
RUN npm install -g npm@latest
WORKDIR /app
COPY ["package.json", "package-lock.json*", "npm-shrinkwrap.json*", "./"]
# RUN npm install --production --silent
@ -70,6 +71,17 @@ COPY . .
RUN npm install
EXPOSE 8080 8081
# Install Python and pip
RUN apk add --no-cache python3 py3-pip
# If you need Python to be the default version, make a symbolic link to python3
RUN if [ ! -e /usr/bin/python ]; then ln -sf python3 /usr/bin/python; fi
# Ensure pip is up to date
#RUN python -m ensurepip --upgrade
RUN python3 -m venv /venv
RUN . /venv/bin/activate && pip install -r agent-py-bot/requirements.txt
#RUN chown -R node /app
#USER node