Skip to content

Commit

Permalink
Update Dockerfile
Browse files Browse the repository at this point in the history
Signed-off-by: mbfannan <[email protected]>
  • Loading branch information
mbfannan authored Nov 13, 2023
1 parent 6821842 commit 0d42af7
Showing 1 changed file with 5 additions and 26 deletions.
31 changes: 5 additions & 26 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit 0d42af7

Please sign in to comment.