From 0d42af7784763df6cae8a2c4918ef9788b81c9c9 Mon Sep 17 00:00:00 2001 From: mbfannan <122257080+mbfannan@users.noreply.github.com> Date: Mon, 13 Nov 2023 14:25:05 +0300 Subject: [PATCH] Update Dockerfile Signed-off-by: mbfannan <122257080+mbfannan@users.noreply.github.com> --- Dockerfile | 31 +++++-------------------------- 1 file changed, 5 insertions(+), 26 deletions(-) diff --git a/Dockerfile b/Dockerfile index 4936c4b2..3664487a 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,46 +1,25 @@ FROM node:lts -# Install Python, pip, venv and other dependencies -RUN apt-get update && \ - apt-get install -y jq python3 python3-pip python3-venv - -# Set the working directory 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" +ARG NODE_ENV +ENV NODE_ENV $NODE_ENV -# Upgrade pip to the latest version -RUN pip install --upgrade pip +COPY --chown=node:node install/package.json /usr/src/app/package.json -# 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 +USER node -# Install Node.js dependencies -COPY --chown=node:node package.json.docker /usr/src/app/package.json RUN npm install && \ npm cache clean --force -# Copy the rest of your application's source code COPY --chown=node:node . /usr/src/app -# Set environment variables ENV NODE_ENV=production \ daemon=false \ silent=false -# Expose the port your app runs on EXPOSE 4567 -# Give execution rights on the scripts -RUN chmod +x create_config.sh - -# Run your setup script and then start NodeBB -CMD ./create_config.sh -n "${SETUP}" && \ - ./nodebb setup || node ./nodebb build; \ - python3 career-model/predict.py; \ - node ./nodebb start +CMD test -n "${SETUP}" && ./nodebb setup || node ./nodebb build; node ./nodebb start