diff --git a/Dockerfile b/Dockerfile index 19605c6bfe73ea9ea2ef0eb71998a1c4e3d0f9b5..ea8a2c209ae793d9c34a6b57529a073dd99e4b10 100644 --- a/Dockerfile +++ b/Dockerfile @@ -21,18 +21,19 @@ RUN apt-get update && \ apt-get install -y --no-install-recommends \ build-essential \ gettext \ - libjs-bootstrap4 \ libpq5 \ libpq-dev \ libssl-dev \ - netcat-openbsd + netcat-openbsd \ + npm # Install core dependnecies WORKDIR /usr/src/app COPY poetry.lock pyproject.toml ./ RUN pip install "poetry==$POETRY_VERSION"; \ poetry export -f requirements.txt | pip install -r /dev/stdin; \ - pip install gunicorn + pip install gunicorn; \ + npm install -g bower # Install core COPY biscuit ./biscuit/ @@ -42,20 +43,24 @@ RUN mkdir -p /var/lib/biscuit/media /var/lib/biscuit/static /var/lib/biscuit/bac # Build messages and assets RUN python manage.py compilemessages; \ + python manage.py bower install; \ python manage.py collectstatic --no-input --clear # Clean up build dependencies -RUN apt-get remove --purge -y \ +RUN npm ls -gp --depth=0 | awk -F/ '/node_modules/ && !/\/npm$/ {print $NF}' | xargs npm -g rm; \ + apt-get remove --purge -y \ build-essential \ gettext \ libpq-dev \ libssl-dev \ + npm \ python3-dev; \ apt-get autoremove --purge -y; \ apt-get clean -y; \ pip uninstall -y poetry; \ rm -f /var/lib/apt/lists/*_*; \ - rm -rf /root/.cache + rm -rf /root/.cache; \ + rm -rf biscuit/bower # Declare a persistent volume for all data VOLUME /var/lib/biscuit diff --git a/docker/nginx/Dockerfile b/docker/nginx/Dockerfile index 9645e8f005e8fcb5df44150d101e5166da4a60d0..e47ed67f547c508c1d18dc5ae6184f1fef90f873 100644 --- a/docker/nginx/Dockerfile +++ b/docker/nginx/Dockerfile @@ -3,7 +3,4 @@ FROM nginx RUN rm /etc/nginx/conf.d/default.conf COPY nginx.conf /etc/nginx/conf.d -RUN apt-get update && apt-get upgrade -y -RUN apt-get install -y libjs-bootstrap4 fonts-font-awesome libjs-jquery libjs-popper.js libjs-jquery-datatables - RUN mkdir /var/lib/biscuit diff --git a/docker/nginx/nginx.conf b/docker/nginx/nginx.conf index 41f0bc39eeeb1233fdad9460ba953ca4e0dc3319..39c2ce0be8a1992be9215f64da3ce7ed02527c7d 100644 --- a/docker/nginx/nginx.conf +++ b/docker/nginx/nginx.conf @@ -19,8 +19,4 @@ server { location /static/ { alias /var/lib/biscuit/static/; } - - location /javascript/ { - alias /usr/share/javascript/; - } }