From 450d692d5b595127cae2005985bc61951346c6d0 Mon Sep 17 00:00:00 2001 From: retrozenith <80767544+retrozenith@users.noreply.github.com> Date: Sun, 28 Dec 2025 13:08:47 +0200 Subject: [PATCH] feat(docker): disable Next.js telemetry in containerized deployments - Add NEXT_TELEMETRY_DISABLED=1 to Dockerfile (builder and runner stages) - Add NEXT_TELEMETRY_DISABLED=1 to docker-compose.yml - Add build-args to GitHub Actions workflow - Document environment variables in README This ensures no telemetry data is collected from containerized deployments, respecting user privacy and reducing network overhead. --- .github/workflows/docker-build.yml | 2 ++ Dockerfile | 5 +++++ README.md | 17 +++++++++++++++++ docker-compose.yml | 3 ++- 4 files changed, 26 insertions(+), 1 deletion(-) diff --git a/.github/workflows/docker-build.yml b/.github/workflows/docker-build.yml index 40df1f2..843398c 100644 --- a/.github/workflows/docker-build.yml +++ b/.github/workflows/docker-build.yml @@ -63,6 +63,8 @@ jobs: cache-from: type=gha cache-to: type=gha,mode=max platforms: linux/amd64,linux/arm64 + build-args: | + NEXT_TELEMETRY_DISABLED=1 - name: Image digest run: echo ${{ steps.meta.outputs.digest }} diff --git a/Dockerfile b/Dockerfile index 0b025fd..3ee1f75 100644 --- a/Dockerfile +++ b/Dockerfile @@ -13,6 +13,9 @@ RUN npm ci --only=production && \ FROM node:20-alpine AS builder WORKDIR /app +# Disable Next.js telemetry during build +ENV NEXT_TELEMETRY_DISABLED=1 + # Copy package files COPY package.json package-lock.json ./ @@ -31,6 +34,8 @@ WORKDIR /app # Set environment to production ENV NODE_ENV=production +# Disable Next.js telemetry +ENV NEXT_TELEMETRY_DISABLED=1 # Create non-root user for security RUN addgroup --system --gid 1001 nodejs && \ diff --git a/README.md b/README.md index 9e17be5..f194811 100644 --- a/README.md +++ b/README.md @@ -131,6 +131,23 @@ The Docker container exposes port 3000 by default. You can customize the port ma docker run -p 8080:3000 tuxmate:latest ``` +### Environment Variables + +The following environment variables are configured by default: + +- `NODE_ENV=production` - Run in production mode +- `PORT=3000` - Application port +- `NEXT_TELEMETRY_DISABLED=1` - Disable Next.js anonymous telemetry + +You can override these when running the container: + +```bash +docker run -p 3000:3000 \ + -e PORT=3000 \ + -e NEXT_TELEMETRY_DISABLED=1 \ + tuxmate:latest +``` + diff --git a/docker-compose.yml b/docker-compose.yml index e3ea7a2..cdbf10d 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -5,13 +5,14 @@ services: build: context: . dockerfile: Dockerfile - image: tuxmate:latest + image: ghcr.io/retrozenith/tuxmate:latest container_name: tuxmate ports: - "3000:3000" environment: - NODE_ENV=production - PORT=3000 + - NEXT_TELEMETRY_DISABLED=1 restart: unless-stopped healthcheck: test: ["CMD", "wget", "--quiet", "--tries=1", "--spider", "http://localhost:3000"]