mirror of
https://github.com/abusoww/tuxmate.git
synced 2026-04-17 19:53:11 +02:00
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.
This commit is contained in:
2
.github/workflows/docker-build.yml
vendored
2
.github/workflows/docker-build.yml
vendored
@@ -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 }}
|
||||
|
||||
@@ -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 && \
|
||||
|
||||
17
README.md
17
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
|
||||
```
|
||||
|
||||
</details>
|
||||
|
||||
|
||||
|
||||
@@ -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"]
|
||||
|
||||
Reference in New Issue
Block a user