diff --git a/apps/web/.dockerignore b/apps/web/.dockerignore deleted file mode 100644 index 40f4110874..0000000000 --- a/apps/web/.dockerignore +++ /dev/null @@ -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 diff --git a/apps/web/Dockerfile b/apps/web/Dockerfile index d6dfa52804..7cc187024b 100644 --- a/apps/web/Dockerfile +++ b/apps/web/Dockerfile @@ -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 diff --git a/apps/web/Dockerfile.dockerignore b/apps/web/Dockerfile.dockerignore new file mode 100644 index 0000000000..403d667eaa --- /dev/null +++ b/apps/web/Dockerfile.dockerignore @@ -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/