Optimise docker context (#32870)

* Optimise docker context

Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>

* Optimise docker context further

Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>

* Debug

Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>

* Iterate

Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>

---------

Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
This commit is contained in:
Michael Telatynski
2026-03-20 14:26:32 +01:00
committed by GitHub
parent 1493e41c29
commit 8f01b2b3db
3 changed files with 36 additions and 16 deletions
-13
View File
@@ -1,13 +0,0 @@
# Exclude a bunch of stuff which can make the build context a larger than it needs to be
test/
webapp/
lib/
node_modules/
karma-reports/
.idea/
.tmp/
config.json*
.link-config
# Exclude the playwright directory as much as we can as the snapshots are huge and we bind mount it in
playwright/
!playwright/docker-entrypoint.sh
+8 -3
View File
@@ -1,4 +1,5 @@
# syntax=docker.io/docker/dockerfile:1.22-labs@sha256:4c116b618ed48404d579b5467127b20986f2a6b29e4b9be2fee841f632db6a86
# Context must be the root of the monorepo
# Builder
FROM --platform=$BUILDPLATFORM node:24-bullseye@sha256:4bfbd78e049926e4ca595c1798810691ca7bb5aedd829ffd8a78b2ab30689810 AS builder
@@ -10,11 +11,15 @@ ARG JS_SDK_BRANCH="master"
WORKDIR /src
COPY --exclude=docker . /src
# Install dependencies
COPY --parents package.json pnpm-lock.yaml pnpm-workspace.yaml patches scripts **/package.json /src/
RUN corepack enable
RUN /src/scripts/docker-link-repos.sh
RUN --mount=type=bind,source=.git,target=/src/.git /src/scripts/docker-link-repos.sh
RUN pnpm install
RUN /src/scripts/docker-package.sh
# Build
COPY --link --exclude=.git --exclude=apps/web/docker . /src
RUN --mount=type=bind,source=.git,target=/src/.git /src/scripts/docker-package.sh
# Copy the config now so that we don't create another layer in the app image
RUN cp /src/apps/web/config.sample.json /src/apps/web/webapp/config.json
+28
View File
@@ -0,0 +1,28 @@
# Exclude a bunch of stuff which can make the build context a larger than it needs to be
**/test/
**/*.stories.tsx
**/*.test.ts
**/*.test.tsx
**/lib/
**/dist/
**/node_modules/
**/coverage/
**/.pnpm-store
**/tsconfig.node.tsbuildinfo
**/*.md
**/*.rst
.idea/
.tmp/
.nx/
.link-config
apps/web/config.json*
apps/web/webpack-stats.json
apps/web/playwright/
apps/web/webapp/
apps/web/debian/
packages/shared-components/__vis__/
packages/shared-components/storybook-static/
packages/shared-components/typedoc/