diff --git a/.changeset/beige-queens-crash.md b/.changeset/beige-queens-crash.md new file mode 100644 index 0000000000..7bc2e2da94 --- /dev/null +++ b/.changeset/beige-queens-crash.md @@ -0,0 +1,13 @@ +--- +'@backstage/create-app': patch +--- + +Optimized the `yarn install` step in the backend `Dockerfile`. + +To apply these changes to an existing app, make the following changes to `packages/backend/Dockerfile`: + +Replace the `RUN yarn install ...` line with the following: + +```bash +RUN yarn install --frozen-lockfile --production --network-timeout 600000 && rm -rf "$(yarn cache dir)" +``` diff --git a/packages/backend/Dockerfile b/packages/backend/Dockerfile index 93929ceb86..165fd021ff 100644 --- a/packages/backend/Dockerfile +++ b/packages/backend/Dockerfile @@ -7,7 +7,7 @@ WORKDIR /usr/src/app # and along with yarn.lock and the root package.json, that's enough to run yarn install. ADD yarn.lock package.json skeleton.tar ./ -RUN yarn install --frozen-lockfile --production +RUN yarn install --frozen-lockfile --production --network-timeout 600000 && rm -rf "$(yarn cache dir)" # This will copy the contents of the dist-workspace when running the build-image command. # Do not use this Dockerfile outside of that command, as it will copy in the source code instead. diff --git a/packages/create-app/templates/default-app/packages/backend/Dockerfile b/packages/create-app/templates/default-app/packages/backend/Dockerfile index 0fcd23f0e1..58f522adc9 100644 --- a/packages/create-app/templates/default-app/packages/backend/Dockerfile +++ b/packages/create-app/templates/default-app/packages/backend/Dockerfile @@ -7,7 +7,7 @@ WORKDIR /usr/src/app # and along with yarn.lock and the root package.json, that's enough to run yarn install. ADD yarn.lock package.json skeleton.tar ./ -RUN yarn install --frozen-lockfile --production +RUN yarn install --frozen-lockfile --production --network-timeout 600000 && rm -rf "$(yarn cache dir)" # This will copy the contents of the dist-workspace when running the build-image command. # Do not use this Dockerfile outside of that command, as it will copy in the source code instead.