diff --git a/ui/.dockerignore b/ui/.dockerignore new file mode 100644 index 0000000000..dcb7653c9c --- /dev/null +++ b/ui/.dockerignore @@ -0,0 +1,17 @@ +# The image serves static files only: the Dockerfile copies index.html, +# silent-callback.html and dist/, and nothing else is needed at build time. +# +# Without this file the whole ui/ tree is sent to the daemon as build context - +# node_modules alone dwarfs everything the image actually contains, which makes a +# three-COPY build take minutes. +# +# Allowlist rather than denylist: adding a COPY without extending this list fails +# the build instead of silently depending on whatever happens to be lying around. +* +!index.html +!silent-callback.html +!dist + +# Source maps are only produced by `npm start` (esbuild serve); keep stale ones left in a +# local dist/ out of locally built images. +dist/**/*.map diff --git a/ui/Dockerfile b/ui/Dockerfile index aae579baa6..7bc9fbc23b 100644 --- a/ui/Dockerfile +++ b/ui/Dockerfile @@ -14,4 +14,5 @@ FROM nginxinc/nginx-unprivileged:alpine WORKDIR /usr/share/nginx/html COPY ./index.html . +COPY ./silent-callback.html . COPY ./dist ./dist diff --git a/ui/build.mjs b/ui/build.mjs index 9c504936a0..e2fe3b3c3b 100644 --- a/ui/build.mjs +++ b/ui/build.mjs @@ -3,7 +3,7 @@ import * as esbuild from 'esbuild'; import {sassPlugin} from 'esbuild-sass-plugin'; const config = { - entryPoints: ['main.ts'], + entryPoints: ['main.ts', 'silent-callback.ts'], bundle: true, outdir: 'dist', loader: { diff --git a/ui/silent-callback.html b/ui/silent-callback.html index 1cf061774a..e77fde2ec5 100644 --- a/ui/silent-callback.html +++ b/ui/silent-callback.html @@ -4,28 +4,6 @@