chore: Update Dockerfile to include UI files and fix build process

This commit is contained in:
Théophile Diot 2024-08-02 15:35:23 +01:00
parent 07186e4ede
commit aaf7c4a303
No known key found for this signature in database
GPG key ID: FA995104A0BA376A
6 changed files with 122 additions and 8 deletions

View file

@ -39,6 +39,9 @@ RUN export MAKEFLAGS="-j$(nproc)" && \
pip install --break-system-packages --no-cache-dir --require-hashes --ignore-installed -r /tmp/requirements-deps.txt && \
pip install --break-system-packages --no-cache-dir --require-hashes --target deps/python $(for file in $(ls /tmp/req/requirements*.txt) ; do echo "-r ${file}" ; done | xargs)
# Install node and npm to build vite frontend
RUN apt-get install -y --no-install-recommends nodejs npm
# Copy files
# can't exclude deps from . so we are copying everything by hand
COPY src/bw/loading loading
@ -55,9 +58,25 @@ COPY src/common/settings.json settings.json
COPY src/common/utils utils
COPY src/common/templates templates
COPY src/scheduler scheduler
COPY src/ui ui
COPY src/VERSION VERSION
COPY src/ui/builder ui/builder
COPY src/ui/client ui/client
COPY src/ui/static ui/static
COPY src/ui/templates ui/templates
# This will build the frontend and add files to the UI folder
WORKDIR /usr/share/bunkerweb/ui/client
RUN DOCKERFILE=yes python3 build.py
# We can delete the client folder after building the frontend
RUN rm -rf /usr/share/bunkerweb/ui/client
WORKDIR /usr/share/bunkerweb
COPY src/ui/src ui/src
COPY src/ui/*.py ui/
FROM debian:bookworm-slim@sha256:d02c76d82364cedca16ba3ed6f9102406fa9fa8833076a609cabf14270f43dfc
# Set default umask to prevent huge recursive chmod increasing the final image size

View file

@ -35,6 +35,9 @@ RUN export MAKEFLAGS="-j$(nproc)" && \
pip install --no-cache-dir --require-hashes --ignore-installed -r /tmp/requirements-deps.txt && \
pip install --no-cache-dir --require-hashes --target deps/python $(for file in $(ls /tmp/req/requirements*.txt) ; do echo "-r ${file}" ; done | xargs)
# Install node and npm to build vite frontend
RUN dnf install -y nodejs npm
# Copy files
# can't exclude deps from . so we are copying everything by hand
COPY src/bw/loading loading
@ -51,9 +54,25 @@ COPY src/common/settings.json settings.json
COPY src/common/utils utils
COPY src/common/templates templates
COPY src/scheduler scheduler
COPY src/ui ui
COPY src/VERSION VERSION
COPY src/ui/builder ui/builder
COPY src/ui/client ui/client
COPY src/ui/static ui/static
COPY src/ui/templates ui/templates
# This will build the frontend and add files to the UI folder
WORKDIR /usr/share/bunkerweb/ui/client
RUN DOCKERFILE=yes python3 build.py
# We can delete the client folder after building the frontend
RUN rm -rf /usr/share/bunkerweb/ui/client
WORKDIR /usr/share/bunkerweb
COPY src/ui/src ui/src
COPY src/ui/*.py ui/
FROM fedora:40@sha256:5ce8497aeea599bf6b54ab3979133923d82aaa4f6ca5ced1812611b197c79eb0
# Set default umask to prevent huge recursive chmod increasing the final image size

View file

@ -46,7 +46,10 @@ RUN export MAKEFLAGS="-j$(nproc)" && \
pip install --no-cache-dir --require-hashes --ignore-installed -r /tmp/requirements-deps.txt && \
pip install --no-cache-dir --require-hashes --target deps/python $(for file in $(ls /tmp/req/requirements*.txt) ; do echo "-r ${file}" ; done | xargs)
# Copy BW files
# Install node and npm to build vite frontend
RUN dnf install -y nodejs npm
# Copy files
# can't exclude deps from . so we are copying everything by hand
COPY src/bw/loading loading
COPY src/bw/lua lua
@ -62,9 +65,25 @@ COPY src/common/settings.json settings.json
COPY src/common/utils utils
COPY src/common/templates templates
COPY src/scheduler scheduler
COPY src/ui ui
COPY src/VERSION VERSION
COPY src/ui/builder ui/builder
COPY src/ui/client ui/client
COPY src/ui/static ui/static
COPY src/ui/templates ui/templates
# This will build the frontend and add files to the UI folder
WORKDIR /usr/share/bunkerweb/ui/client
RUN DOCKERFILE=yes python3 build.py
# We can delete the client folder after building the frontend
RUN rm -rf /usr/share/bunkerweb/ui/client
WORKDIR /usr/share/bunkerweb
COPY src/ui/src ui/src
COPY src/ui/*.py ui/
FROM redhat/ubi8:8.10@sha256:44d75007b39e0e1bbf1bcfd0721245add54c54c3f83903f8926fb4bef6827aa2
# Set default umask to prevent huge recursive chmod increasing the final image size

View file

@ -49,7 +49,10 @@ RUN export MAKEFLAGS="-j$(nproc)" && \
python3 -m pip install --no-cache-dir --require-hashes --ignore-installed -r /tmp/requirements-deps.txt && \
python3 -m pip install --no-cache-dir --require-hashes --target deps/python $(for file in $(ls /tmp/req/requirements*.txt) ; do echo "-r ${file}" ; done | xargs)
# Copy BW files
# Install node and npm to build vite frontend
RUN dnf install -y nodejs npm
# Copy files
# can't exclude deps from . so we are copying everything by hand
COPY src/bw/loading loading
COPY src/bw/lua lua
@ -65,9 +68,25 @@ COPY src/common/settings.json settings.json
COPY src/common/utils utils
COPY src/common/templates templates
COPY src/scheduler scheduler
COPY src/ui ui
COPY src/VERSION VERSION
COPY src/ui/builder ui/builder
COPY src/ui/client ui/client
COPY src/ui/static ui/static
COPY src/ui/templates ui/templates
# This will build the frontend and add files to the UI folder
WORKDIR /usr/share/bunkerweb/ui/client
RUN DOCKERFILE=yes python3 build.py
# We can delete the client folder after building the frontend
RUN rm -rf /usr/share/bunkerweb/ui/client
WORKDIR /usr/share/bunkerweb
COPY src/ui/src ui/src
COPY src/ui/*.py ui/
FROM redhat/ubi9:9.4@sha256:1ee4d8c50d14d9c9e9229d9a039d793fcbc9aa803806d194c957a397cf1d2b17
# Set default umask to prevent huge recursive chmod increasing the final image size

View file

@ -39,6 +39,9 @@ RUN export MAKEFLAGS="-j$(nproc)" && \
pip install --no-cache-dir --require-hashes --break-system-packages --ignore-installed -r /tmp/requirements-deps.txt && \
pip install --no-cache-dir --require-hashes --break-system-packages --target deps/python $(for file in $(ls /tmp/req/requirements*.txt) ; do echo "-r ${file}" ; done | xargs)
# Install node and npm to build vite frontend
RUN apt-get install -y --no-install-recommends nodejs npm
# Copy files
# can't exclude deps from . so we are copying everything by hand
COPY src/bw/loading loading
@ -55,9 +58,25 @@ COPY src/common/settings.json settings.json
COPY src/common/utils utils
COPY src/common/templates templates
COPY src/scheduler scheduler
COPY src/ui ui
COPY src/VERSION VERSION
COPY src/ui/builder ui/builder
COPY src/ui/client ui/client
COPY src/ui/static ui/static
COPY src/ui/templates ui/templates
# This will build the frontend and add files to the UI folder
WORKDIR /usr/share/bunkerweb/ui/client
RUN DOCKERFILE=yes python3 build.py
# We can delete the client folder after building the frontend
RUN rm -rf /usr/share/bunkerweb/ui/client
WORKDIR /usr/share/bunkerweb
COPY src/ui/src ui/src
COPY src/ui/*.py ui/
FROM ubuntu:24.04@sha256:562456a05a0dbd62a671c1854868862a4687bf979a96d48ae8e766642cd911e8
# Set default umask to prevent huge recursive chmod increasing the final image size

View file

@ -39,6 +39,9 @@ RUN export MAKEFLAGS="-j$(nproc)" && \
pip install --no-cache-dir --require-hashes --ignore-installed -r /tmp/requirements-deps.txt && \
pip install --no-cache-dir --require-hashes --target deps/python $(for file in $(ls /tmp/req/requirements*.txt) ; do echo "-r ${file}" ; done | xargs)
# Install node and npm to build vite frontend
RUN apt-get install -y --no-install-recommends nodejs npm
# Copy files
# can't exclude deps from . so we are copying everything by hand
COPY src/bw/loading loading
@ -55,9 +58,25 @@ COPY src/common/settings.json settings.json
COPY src/common/utils utils
COPY src/common/templates templates
COPY src/scheduler scheduler
COPY src/ui ui
COPY src/VERSION VERSION
COPY src/ui/builder ui/builder
COPY src/ui/client ui/client
COPY src/ui/static ui/static
COPY src/ui/templates ui/templates
# This will build the frontend and add files to the UI folder
WORKDIR /usr/share/bunkerweb/ui/client
RUN DOCKERFILE=yes python3 build.py
# We can delete the client folder after building the frontend
RUN rm -rf /usr/share/bunkerweb/ui/client
WORKDIR /usr/share/bunkerweb
COPY src/ui/src ui/src
COPY src/ui/*.py ui/
FROM ubuntu:22.04@sha256:340d9b015b194dc6e2a13938944e0d016e57b9679963fdeb9ce021daac430221
# Set default umask to prevent huge recursive chmod increasing the final image size