Skip to content
Snippets Groups Projects
Verified Commit 22123c8c authored by Andreas Ellewsen's avatar Andreas Ellewsen
Browse files

Stop copying node_modules into frontend image

By not having a .dockerignore file we are including the node_modules
directory in the frontend image, and then installing all the packages a
second time in the build phase when we run npm ci. We now let npm ci do
that work as it's supposed to.
parent fb2e0e7f
No related branches found
No related tags found
1 merge request!331Stop copying node_modules into frontend image
Pipeline #140378 passed
......@@ -10,6 +10,12 @@ APP_NAME="greg-frontend"
CONTAINER="${REPO}/${PROJECT}/${APP_NAME}"
IMAGE_TAG="${CONTAINER}:${GIT_BRANCH}-${GIT_SHA}"
echo "Generating .dockerignore"
echo ".*
*" > .dockerignore
git ls-tree --name-only HEAD | sed 's/^/!/' >> .dockerignore
echo "**/node_modules" >> .dockerignore
if command -v podman > /dev/null 2>&1; then
BUILDER=$(command -v podman)
else
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment