diff --git a/web-frontend/docker/Dockerfile.dev b/web-frontend/docker/Dockerfile.dev index 2fb370680..dbe3bdc55 100644 --- a/web-frontend/docker/Dockerfile.dev +++ b/web-frontend/docker/Dockerfile.dev @@ -32,7 +32,6 @@ ADD --chown=$UID:$GID ./web-frontend/package.json ./web-frontend/yarn.lock /base WORKDIR /baserow/web-frontend -VOLUME ["/baserow/web-frontend/node_modules"] RUN yarn install @@ -42,6 +41,8 @@ ADD --chown=$UID:$GID ./premium/web-frontend /baserow/web-frontend/plugins/premi RUN dos2unix /baserow/web-frontend/docker/docker-entrypoint.sh && \ chmod a+x /baserow/web-frontend/docker/docker-entrypoint.sh +# Ensure we don't overwrite the built node_modules with an empty mount from a fresh checkout. +VOLUME ["/baserow/web-frontend/node_modules"] # Ensure we don't pollute the devs actual repo when mounting in files by # putting the plugins into an anonymous docker volumes. VOLUME ["/baserow/web-frontend/plugins"] diff --git a/web-frontend/docker/docker-entrypoint.sh b/web-frontend/docker/docker-entrypoint.sh index 3ace5f1a1..7e069597e 100644 --- a/web-frontend/docker/docker-entrypoint.sh +++ b/web-frontend/docker/docker-entrypoint.sh @@ -18,16 +18,6 @@ help : Show this message """ } -# If the image is running with a volume mounted into /baserow/web-frontend/ it will overwrite -# the images node_modules folder. If the user has mounted in a folder without their own -# node_modules we will copy in the preinstalled image modules for them. This happens on a -# clean first checkout and run of a dev environment. -if [ -d "/baserow/web-frontend-modules/" ] && [ ! -d "/baserow/web-frontend/node_modules/" ]; then - echo "Setting up preinstalled yarn modules from image into web-frontend/node_modules" - mv /baserow/web-frontend-modules/ /baserow/web-frontend/node_modules/ -fi - - case "$1" in dev) CMD="yarn run dev" @@ -55,4 +45,4 @@ case "$1" in show_help exit 1 ;; -esac \ No newline at end of file +esac