Add npm to Dockerfile

This commit is contained in:
Iurii Tatishchev 2021-05-29 14:22:23 -07:00
parent abd1965285
commit a03456c60c
Signed by: CaZzzer
GPG Key ID: 926BE949E29DCD03
3 changed files with 71 additions and 10048 deletions

View File

@ -1,11 +1,14 @@
FROM python:3.9 as builder
# enchant dependency for sphinx
RUN apt-get update && apt-get install -y python-enchant
# enchant dependency for sphinx and npm for webpack
RUN apt-get update && apt-get install -y python-enchant npm
# copy source files
WORKDIR /access_controller/
COPY ./ /access_controller
# dev requirements for building sphinx docs
RUN pip install -r requirements/dev.txt -r requirements/prod.txt
# build js dist
RUN npm install -g npx
RUN (cd main/control_page_js_modules && npm install && npx webpack)
# build static and documentation files into build/webserver
RUN ./manage.py collectstatic --no-input && ./documentation.sh
# create production venv to copy to final image
@ -22,5 +25,6 @@ USER actrl
EXPOSE 8000
CMD . venv/bin/activate && \
python manage.py migrate && \
rm -rf srv/* && \
cp -rT webserver srv && \
daphne -b 0.0.0.0 access_controller.asgi:application

File diff suppressed because it is too large Load Diff

View File

@ -22,7 +22,9 @@
"react": "^17.0.2",
"react-dom": "^17.0.2",
"save-dev": "0.0.1-security",
"webpack": "^5.36.2",
"webpack-cli": "^4.6.0"
"webpack": "^5.36.2"
},
"devDependencies": {
"webpack-cli": "^4.7.0"
}
}