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.
TypeScript analyticsaudience-segmentationchartscohort-analysisgoogle-analyticsproduct-analyticsstatisticsuser-journeyweb-analytics
Dockerfile tweaks.
Mike Cao340cdce1dcc0
diff --git a/Dockerfile b/Dockerfileindex 83b4d514f..f17410859 100644--- a/Dockerfile+++ b/Dockerfile@@ -21,8 +21,7 @@ ENV BASE_PATH=$BASE_PATHENV NEXT_TELEMETRY_DISABLED=1-RUN npm install -g pnpm-RUN pnpm build-docker+RUN npm run build-docker# Production image, copy all the files and run nextFROM node:22-alpine AS runner@@ -39,10 +38,13 @@ RUN adduser --system --uid 1001 nextjsRUN npm install -g pnpmRUN set -x \- && apk add --no-cache curl \- && pnpm add npm-run-all dotenv [email protected]+ && apk add --no-cache curl++# Script dependencies+RUN pnpm add npm-run-all dotenv [email protected]-RUN chown -R nextjs:nodejs node_modules/+# Permissions for prisma+RUN chown -R nextjs:nodejs node_modules/.pnpm/COPY --from=builder --chown=nextjs:nodejs /app/public ./publicCOPY --from=builder /app/prisma ./prisma@@ -53,6 +55,7 @@ COPY --from=builder /app/scripts ./scriptsCOPY --from=builder --chown=nextjs:nodejs /app/.next/standalone ./COPY --from=builder --chown=nextjs:nodejs /app/.next/static ./.next/static+# Custom routesRUN mv ./.next/routes-manifest.json ./.next/routes-manifest-orig.jsonUSER nextjsdiff --git a/scripts/set-routes-manifest.js b/scripts/set-routes-manifest.jsindex e28cdcaf4..a3ac49562 100644--- a/scripts/set-routes-manifest.js+++ b/scripts/set-routes-manifest.js@@ -17,7 +17,7 @@ const headers = [];const rewrites = [];if (collectApiEndpoint) {- const apiRoute = originalManifest.headers.find((route) => route.source === API_PATH);+ const apiRoute = originalManifest.headers.find(route => route.source === API_PATH);const routeRegex = new RegExp(apiRoute.regex);rewrites.push({@@ -34,7 +34,7 @@ if (collectApiEndpoint) {}if (trackerScriptName) {- const trackerRoute = originalManifest.headers.find((route) => route.source === TRACKER_SCRIPT);+ const trackerRoute = originalManifest.headers.find(route => route.source === TRACKER_SCRIPT);const names = trackerScriptName?.split(',').map(name => name.trim());@@ -57,11 +57,11 @@ if (trackerScriptName) {const routesManifest = { ...originalManifest };-if (rewrites.length != 0) {+if (rewrites.length !== 0) {const { buildCustomRoute } = require('next/dist/lib/build-custom-route');- const builtHeaders = headers.map((header) => buildCustomRoute('header', header));- const builtRewrites = rewrites.map((rewrite) => buildCustomRoute('rewrite', rewrite));+ const builtHeaders = headers.map(header => buildCustomRoute('header', header));+ const builtRewrites = rewrites.map(rewrite => buildCustomRoute('rewrite', rewrite));routesManifest.headers = [...originalManifest.headers, ...builtHeaders];routesManifest.rewrites = [...builtRewrites, ...originalManifest.rewrites];