generated from CMU-17313Q/NodeBB-f23
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: mbfannan <[email protected]>
- Loading branch information
Showing
1 changed file
with
5 additions
and
26 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |