diff --git a/Dockerfile b/Dockerfile index 1bbdd4e..6510a3c 100644 --- a/Dockerfile +++ b/Dockerfile @@ -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 . . diff --git a/docker-compose.yml b/docker-compose.yml index fb48d13..3bcb998 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -7,5 +7,3 @@ services: volumes: - .:/app - /app/node_modules - - /app/modules - - ./modules:/modules diff --git a/full-install.sh b/full-install.sh new file mode 100755 index 0000000..4a3366e --- /dev/null +++ b/full-install.sh @@ -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 diff --git a/package.json b/package.json index ff7c44a..54bb735 100644 --- a/package.json +++ b/package.json @@ -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": [