@@ -8,7 +8,7 @@ FROM ${NODE_IMAGE} AS pruner
88WORKDIR /triggerdotdev
99
1010COPY --chown=node:node . .
11- RUN npx -q turbo@1.10.9 prune --scope=webapp --docker
11+ RUN npx -q turbo@2.5.4 prune --scope=webapp --docker
1212RUN find . -name "node_modules" -type d -prune -exec rm -rf '{}' +
1313
1414# Base strategy to have layer caching
@@ -19,34 +19,34 @@ COPY --chown=node:node .gitignore .gitignore
1919COPY --from=pruner --chown=node:node /triggerdotdev/out/json/ .
2020COPY --from=pruner --chown=node:node /triggerdotdev/out/pnpm-lock.yaml ./pnpm-lock.yaml
2121COPY --from=pruner --chown=node:node /triggerdotdev/out/pnpm-workspace.yaml ./pnpm-workspace.yaml
22+ COPY --chown=node:node patches ./patches
2223
2324# # Dev deps
2425FROM base AS dev-deps
2526WORKDIR /triggerdotdev
26- # Corepack is used to install pnpm
27- RUN corepack enable
28- ENV NODE_ENV development
29- RUN --mount=type=cache,id=pnpm,target=/root/.local/share/pnpm/store pnpm install --ignore-scripts --no-frozen-lockfile
27+ # Corepack is used to install pnpm with the exact version from packageManager
28+ RUN corepack enable && corepack prepare pnpm@10.23.0 --activate
29+ ENV NODE_ENV=development
30+ RUN --mount=type=cache,id=pnpm,target=/root/.local/share/pnpm/store pnpm install --no-frozen-lockfile
31+ # Generate Prisma client here where all deps are installed
32+ COPY --from=pruner --chown=node:node /triggerdotdev/internal-packages/database/prisma/schema.prisma /triggerdotdev/internal-packages/database/prisma/schema.prisma
33+ RUN pnpx prisma@6.14.0 generate --schema /triggerdotdev/internal-packages/database/prisma/schema.prisma
3034
3135# # Production deps
3236FROM base AS production-deps
3337WORKDIR /triggerdotdev
34- # Corepack is used to install pnpm
35- RUN corepack enable
36- ENV NODE_ENV production
38+ # Corepack is used to install pnpm with the exact version from packageManager
39+ RUN corepack enable && corepack prepare pnpm@10.23.0 --activate
40+ ENV NODE_ENV= production
3741RUN --mount=type=cache,id=pnpm,target=/root/.local/share/pnpm/store pnpm install --prod --no-frozen-lockfile
38- COPY --from=pruner --chown=node:node /triggerdotdev/internal-packages/database/prisma/schema.prisma /triggerdotdev/internal-packages/database/prisma/schema.prisma
39- # RUN pnpm add @prisma/client@6.14.0 -w
40- ENV NPM_CONFIG_IGNORE_WORKSPACE_ROOT_CHECK true
41- RUN --mount=type=cache,id=pnpm,target=/root/.local/share/pnpm/store pnpx prisma@6.14.0 generate --schema /triggerdotdev/internal-packages/database/prisma/schema.prisma
4242
4343# # Builder (builds the webapp)
4444FROM base AS builder
4545# This is needed for the sentry-cli binary while building the webapp
4646RUN apt-get update && apt-get install -y openssl dumb-init ca-certificates
4747WORKDIR /triggerdotdev
48- # Corepack is used to install pnpm
49- RUN corepack enable
48+ # Corepack is used to install pnpm with the exact version from packageManager
49+ RUN corepack enable && corepack prepare pnpm@10.23.0 --activate
5050
5151ARG SENTRY_RELEASE
5252ARG SENTRY_ORG
@@ -67,7 +67,7 @@ COPY --chown=node:node docker/scripts ./scripts
6767RUN chmod +x ./scripts/wait-for-it.sh
6868RUN chmod +x ./scripts/entrypoint.sh
6969COPY --chown=node:node .configs/tsconfig.base.json .configs/tsconfig.base.json
70- COPY --chown=node:node scripts/updateVersion.ts scripts/updateVersion.ts
70+ COPY --chown=node:node scripts/updateVersion.mjs scripts/updateVersion.mjs
7171RUN pnpm run generate
7272RUN --mount=type=secret,id=sentry_auth_token \
7373 SENTRY_AUTH_TOKEN=$(cat /run/secrets/sentry_auth_token) \
@@ -77,11 +77,13 @@ RUN --mount=type=secret,id=sentry_auth_token \
7777FROM ${NODE_IMAGE} AS runner
7878RUN apt-get update && apt-get install -y openssl netcat-openbsd ca-certificates
7979WORKDIR /triggerdotdev
80- ENV NODE_ENV production
80+ ENV NODE_ENV= production
8181
8282COPY --from=base /usr/bin/dumb-init /usr/bin/dumb-init
8383COPY --from=pruner --chown=node:node /triggerdotdev/out/full/ .
8484COPY --from=production-deps --chown=node:node /triggerdotdev .
85+ # Copy generated Prisma client from dev-deps
86+ COPY --from=dev-deps --chown=node:node /triggerdotdev/internal-packages/database/generated ./internal-packages/database/generated
8587COPY --from=builder --chown=node:node /triggerdotdev/apps/webapp/build/server.js ./apps/webapp/build/server.js
8688COPY --from=builder --chown=node:node /triggerdotdev/apps/webapp/build ./apps/webapp/build
8789COPY --from=builder --chown=node:node /triggerdotdev/apps/webapp/public ./apps/webapp/public
@@ -104,11 +106,11 @@ ENV BUILD_APP_VERSION=${BUILD_APP_VERSION} \
104106EXPOSE 3000
105107
106108# Add global pnpm shims and install pnpm during build (root user)
107- RUN corepack enable && corepack prepare --activate
109+ RUN corepack enable && corepack prepare pnpm@10.23.0 --activate
108110
109111USER node
110112
111113# Ensure pnpm is installed during build and not silently downloaded at runtime (node user)
112- RUN corepack prepare --activate
114+ RUN corepack prepare pnpm@10.23.0 --activate
113115
114116CMD ["./scripts/entrypoint.sh" ]
0 commit comments