diff --git a/Dockerfile b/Dockerfile index 7b4c5c0cf..26bedcd4b 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,3 +1,4 @@ +# syntax=docker/dockerfile:1 ############### ### STAGE 1: Build app ############### @@ -37,12 +38,13 @@ ENV PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD=1 COPY ./ /usr/src/app/ -RUN npm cache clear --force +RUN npm config set fetch-retry-maxtimeout 120000 \ + && npm config set registry $NPM_REGISTRY_URL --location=global -RUN npm config set fetch-retry-maxtimeout 120000 -RUN npm config set registry $NPM_REGISTRY_URL --location=global - -RUN npm ci +# BuildKit cache mount: npm ka download cache builds ke beech persist hota hai, +# isliye har build par saare packages dobara download nahi hote (bahut fast). +# 'npm cache clear --force' hata diya — wo har build par cache wipe kar deta tha. +RUN --mount=type=cache,target=/root/.npm npm ci --no-audit --no-fund RUN sh -c "ng build --output-path=/dist $BUILD_ENVIRONMENT_OPTIONS"