Add support for nested node projects

This commit is contained in:
Tanguy Herbron 2021-05-09 20:25:41 +02:00
parent 4a0ebe2845
commit 9817172d65
4 changed files with 15 additions and 3 deletions

View File

@ -1,5 +1,7 @@
FROM node:14-alpine3.10
WORKDIR /app
COPY package.json .
RUN npm install --quiet
COPY ./modules ./modules
COPY full-install.sh .
RUN npm run full-install
COPY . .

View File

@ -7,5 +7,3 @@ services:
volumes:
- .:/app
- /app/node_modules
- /app/modules
- ./modules:/modules

11
full-install.sh Executable file
View File

@ -0,0 +1,11 @@
npm install
echo "Installing dependencies of modules"
for d in modules/* ; do
if test -f "$d/package.json"; then
echo "$d is a node module, installing dependencies"
( cd $d && npm install )
else
echo "$d does not appear to be a node module, skipping"
fi
done

View File

@ -4,6 +4,7 @@
"description": "Modular discord bot mainly intended for moderation usage",
"main": "index.js",
"scripts": {
"full-install": "sh full-install.sh",
"dev": "nodemon index.js"
},
"keywords": [