Skip to content

armgit / umami

Public Imported from GitHub
0

Umami is a privacy-first web and product analytics platform. Traffic, campaigns, behavior, conversions, and revenue in one place. No cookies, no surveillance, self-hosted or in the cloud.

use deps node_modules in runner image

Francis Cao7d687479a957
diff --git a/Dockerfile b/Dockerfile
index ebd6866d4..e6882e048 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -29,7 +29,6 @@ RUN npm run build-docker
FROM node:${NODE_IMAGE_VERSION} AS runner
WORKDIR /app
-ARG PRISMA_VERSION="7.7.0"
ARG NODE_OPTIONS
ENV NODE_ENV=production
@@ -39,17 +38,7 @@ ENV NODE_OPTIONS=$NODE_OPTIONS
RUN addgroup --system --gid 1001 nodejs
RUN adduser --system --uid 1001 nextjs
RUN set -x \
- && apk add --no-cache curl \
- && npm install -g pnpm@${PNPM_VERSION}
-
-# Keep the repo's pnpm build-script policy available in this stage.
-COPY pnpm-workspace.yaml ./
-
-# Script dependencies
-RUN pnpm --allow-build='@prisma/engines,prisma' add npm-run-all dotenv chalk semver \
- prisma@${PRISMA_VERSION} \
- @prisma/client@${PRISMA_VERSION} \
- @prisma/adapter-pg@${PRISMA_VERSION}
+ && apk add --no-cache curl
COPY --from=builder --chown=nextjs:nodejs /app/public ./public
COPY --from=builder /app/prisma ./prisma
@@ -61,6 +50,8 @@ COPY --from=builder /app/generated ./generated
# https://nextjs.org/docs/advanced-features/output-file-tracing
COPY --from=builder --chown=nextjs:nodejs /app/.next/standalone ./
COPY --from=builder --chown=nextjs:nodejs /app/.next/static ./.next/static
+RUN rm -rf /app/node_modules
+COPY --from=deps /app/node_modules ./node_modules
USER nextjs