From 998b06d9afc9deecea49b3df398fa13bf33ee0c2 Mon Sep 17 00:00:00 2001 From: Stephan Barth Date: Fri, 6 Sep 2024 03:07:02 +0200 Subject: [PATCH] build(docker/frontend): Added configuration options for whether to store compilation results in the image or write it back to the file system. --- docker/frontend/Dockerfile | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/docker/frontend/Dockerfile b/docker/frontend/Dockerfile index 6f664a6f2..61a6eba6e 100644 --- a/docker/frontend/Dockerfile +++ b/docker/frontend/Dockerfile @@ -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} \ No newline at end of file +ENTRYPOINT make -- ${FRADRIVE_MAKE_TARGET} CHROME_BIN=${CHROME_BIN}