diff --git a/Dockerfile b/Dockerfile index 2318cea..40df0ea 100644 --- a/Dockerfile +++ b/Dockerfile @@ -30,6 +30,13 @@ RUN npx prisma generate && npm run build # drift from the client the application was built against. dotenv comes along # because prisma.config.ts imports it; in a container the environment is # already populated, but the file is shared with local development. +# +# The CLI ships Prisma Studio, which drags in React and a graph-layout engine +# this image will never run; those are removed here. `effect` looks like part +# of the same bundle but is not — the CLI itself requires it, and removing it +# breaks `migrate deploy` outright. The entrypoint runs a migration on every +# start, so an over-eager prune fails loudly at the first boot rather than +# quietly at the worst moment. # --------------------------------------------------------------------------- FROM node:22-alpine AS migrator WORKDIR /cli @@ -37,7 +44,9 @@ COPY package.json ./ RUN PRISMA_VERSION="$(node -p "require('./package.json').dependencies.prisma")" \ && rm package.json \ && npm init -y > /dev/null \ - && npm install --no-audit --no-fund --omit=dev "prisma@${PRISMA_VERSION}" dotenv + && npm install --no-audit --no-fund --omit=dev "prisma@${PRISMA_VERSION}" dotenv \ + && rm -rf node_modules/react node_modules/react-dom node_modules/scheduler \ + node_modules/elkjs node_modules/@electric-sql # --------------------------------------------------------------------------- # runner — standalone output plus what the migrations need