fix: build the docker image from a remote git context #1118

This commit is contained in:
Linus Rath
2026-09-29 20:57:57 +02:00
parent affa999cd0
commit a1914abfad
2 changed files with 10 additions and 2 deletions
+2 -1
View File
@@ -15,7 +15,8 @@ TODO.md
# Sibling projects / test harness - not part of the webmail image
examples/
# Unit tests: `next build` type-checks every .ts file, and some tests import
# routes the Dockerfile deletes (app/api/dev-jmap)
# routes the Dockerfile deletes (app/api/dev-jmap). The Dockerfile deletes the
# tests as well, since a remote Git context skips this file.
**/__tests__
**/*.test.ts
**/*.test.tsx
+8 -1
View File
@@ -23,7 +23,14 @@ ARG GIT_COMMIT=unknown
ENV GIT_COMMIT=$GIT_COMMIT
# The mock JMAP server (DEV_MOCK_JMAP) accepts any password and is for
# `npm run dev` only; images ship without it.
RUN rm -rf "app/api/dev-jmap" && npx next build --webpack
# `next build` type-checks every .ts file, and some unit tests import the
# deleted route, so the tests go too. .dockerignore already drops them from a
# local context, but a remote Git context never applies .dockerignore (#1118).
RUN rm -rf "app/api/dev-jmap" && \
find . -path ./node_modules -prune -o \
\( -name __tests__ -o -name "*.test.ts" -o -name "*.test.tsx" \) \
-prune -exec rm -rf {} \; && \
npx next build --webpack
FROM node:24-alpine AS runner