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.

install heatmaps image

Francis Caoe068471f9cec
diff --git a/.github/workflows/cd-cloud.yml b/.github/workflows/cd-cloud.yml
index 90a09dab0..4e556d80c 100644
--- a/.github/workflows/cd-cloud.yml
+++ b/.github/workflows/cd-cloud.yml
@@ -23,7 +23,7 @@ jobs:
with:
image: umamisoftware/umami
tags: cloud-${{ steps.random_hash.outputs.hash }}, cloud-latest
- buildArgs: DATABASE_TYPE=postgresql
+ buildArgs: DATABASE_TYPE=postgresql,INSTALL_HEATMAP=true
registry: docker.io
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
diff --git a/Dockerfile b/Dockerfile
index aaa2e27cb..228e5a367 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -1,19 +1,23 @@
ARG NODE_IMAGE_VERSION="22-alpine"
ARG PNPM_VERSION="10.15.1"
+ARG INSTALL_HEATMAP="false"
# Install dependencies only when needed
FROM node:${NODE_IMAGE_VERSION} AS deps
+ARG INSTALL_HEATMAP
+
# Check https://github.com/nodejs/docker-node/tree/b4117f9333da4138b03a546ec926ef50a31506c3#nodealpine to understand why libc6-compat might be needed.
RUN apk add --no-cache libc6-compat
WORKDIR /app
+ENV PLAYWRIGHT_BROWSERS_PATH=/ms-playwright
COPY package.json pnpm-lock.yaml ./
RUN npm install -g pnpm
-RUN cat > pnpm-workspace.yaml << EOF
-strictDepBuilds: false
-EOF
+RUN printf 'strictDepBuilds: false\n' > pnpm-workspace.yaml
RUN pnpm install --frozen-lockfile
+RUN mkdir -p $PLAYWRIGHT_BROWSERS_PATH \
+ && if [ "$INSTALL_HEATMAP" = "true" ]; then pnpm run install-heatmap; fi
# Rebuild the source code only when needed
FROM node:${NODE_IMAGE_VERSION} AS builder
@@ -39,6 +43,7 @@ ARG NODE_OPTIONS
ENV NODE_ENV=production
ENV NEXT_TELEMETRY_DISABLED=1
ENV NODE_OPTIONS=$NODE_OPTIONS
+ENV PLAYWRIGHT_BROWSERS_PATH=/ms-playwright
RUN addgroup --system --gid 1001 nodejs
RUN adduser --system --uid 1001 nextjs
@@ -48,12 +53,7 @@ RUN set -x \
RUN echo {} > package.json
-RUN cat > pnpm-workspace.yaml << EOF
-allowBuilds:
- '@prisma/engines': true
- prisma: false
-verifyDepsBeforeRun: false
-EOF
+RUN printf "allowBuilds:\n '@prisma/engines': true\n prisma: false\nverifyDepsBeforeRun: false\n" > pnpm-workspace.yaml
# Script dependencies
RUN pnpm add npm-run-all dotenv chalk semver \
@@ -66,6 +66,7 @@ COPY --from=builder /app/prisma ./prisma
COPY --from=builder /app/prisma.config.ts ./prisma.config.ts
COPY --from=builder /app/scripts ./scripts
COPY --from=builder /app/generated ./generated
+COPY --from=deps --chown=nextjs:nodejs /ms-playwright /ms-playwright
# Automatically leverage output traces to reduce image size
# https://nextjs.org/docs/advanced-features/output-file-tracing