Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Docker: Allow file based declaration of active modules #10036

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 4 additions & 2 deletions Dockerfile
Expand Up @@ -8,11 +8,13 @@ ARG NODE_ENV
ENV NODE_ENV $NODE_ENV

COPY --chown=node:node install/package.json /usr/src/app/package.json
COPY --chown=node:node install/launch.sh /usr/src/app/launch.sh

USER node

RUN npm install --only=prod && \
npm cache clean --force
npm cache clean --force && \
touch active_modules

COPY --chown=node:node . /usr/src/app

Expand All @@ -22,4 +24,4 @@ ENV NODE_ENV=production \

EXPOSE 4567

CMD test -n "${SETUP}" && ./nodebb setup || node ./nodebb build; node ./nodebb start
CMD ./launch.sh
18 changes: 18 additions & 0 deletions install/launch.sh
@@ -0,0 +1,18 @@
echo "# [Optional] Install "
if test -n "${SETUP}"
then
./nodebb setup
fi

echo "# Checking required modules from ./active_modules"
while read -r module; do
echo "Installing module $module"
npm install "$module"
./nodebb activate $module
done < ./active_modules

echo "# Building nodebb"
node ./nodebb build

echo "# Launching application"
./nodebb start