build(docker/frontend): Added configuration options for whether to store compilation results in the image or write it back to the file system.

This commit is contained in:
Stephan Barth 2024-09-06 03:07:02 +02:00
parent 426ea5b170
commit 998b06d9af

View File

@ -14,9 +14,12 @@ ENV CHROME_BIN=chromium
RUN npm install -g n
RUN n 20.17.0
# locally these two should be identical, so that compilation results are written out into the file dir.
# in CI-pipelines these two should be different, so that the container caches the compilation results.
ARG MOUNT_DIR=/bindmount/fradrive
ARG PROJECT_DIR=/fradrive
RUN mkdir -p ${PROJECT_DIR}
RUN cp -r /tmp${PROJECT_DIR}/* ${PROJECT_DIR}
RUN if [ "${PROJECT_DIR}" != "${MOUNT_DIR}"]; then cp -r ${MOUNT_DIR}/* ${PROJECT_DIR} ; fi
WORKDIR ${PROJECT_DIR}
ENV HOME=${PROJECT_DIR}
@ -24,4 +27,4 @@ RUN make node_modules
RUN make well-known
ENV FRADRIVE_MAKE_TARGET=frontend-watch
ENTRYPOINT make -- ${FRADRIVE_MAKE_TARGET} CHROME_BIN=${CHROME_BIN}
ENTRYPOINT make -- ${FRADRIVE_MAKE_TARGET} CHROME_BIN=${CHROME_BIN}