- Added /_img/ rewrite rule in next.config.mjs to proxy image requests to IMGPROXY_URL - Updated lib/imgproxy.ts to use local /_img path instead of exposed public URL - Replaced NEXT_PUBLIC_IMGPROXY_URL (build-time) with IMGPROXY_URL (runtime) - Updated Dockerfile and docker-compose.yml to strip unused build args
98 lines
6.1 KiB
Plaintext
98 lines
6.1 KiB
Plaintext
# ============================================================================
|
|
# KLZ Cables - Environment Configuration
|
|
# ============================================================================
|
|
# Copy this file to .env for local development
|
|
# For production, use .env.production as a template
|
|
# ============================================================================
|
|
|
|
# ────────────────────────────────────────────────────────────────────────────
|
|
# Application Configuration
|
|
# ────────────────────────────────────────────────────────────────────────────
|
|
NODE_ENV=development
|
|
NEXT_PUBLIC_BASE_URL=http://localhost:3000
|
|
DIRECTUS_PORT=8055
|
|
# TARGET is used to differentiate between environments (testing, staging, production)
|
|
# NEXT_PUBLIC_TARGET makes this information available to the frontend
|
|
TARGET=development
|
|
NEXT_PUBLIC_FEEDBACK_ENABLED=false
|
|
NEXT_PUBLIC_RECORD_MODE_ENABLED=true
|
|
|
|
# ────────────────────────────────────────────────────────────────────────────
|
|
# Analytics (Umami)
|
|
# ────────────────────────────────────────────────────────────────────────────
|
|
# Optional: Leave empty to disable analytics
|
|
UMAMI_WEBSITE_ID=
|
|
UMAMI_API_ENDPOINT=https://analytics.infra.mintel.me
|
|
|
|
# ────────────────────────────────────────────────────────────────────────────
|
|
# Error Tracking (GlitchTip/Sentry)
|
|
# ────────────────────────────────────────────────────────────────────────────
|
|
# Optional: Leave empty to disable error tracking
|
|
SENTRY_DSN=
|
|
|
|
# ────────────────────────────────────────────────────────────────────────────
|
|
# Email Configuration (SMTP)
|
|
# ────────────────────────────────────────────────────────────────────────────
|
|
# Required for contact form functionality
|
|
MAIL_HOST=smtp.eu.mailgun.org
|
|
MAIL_PORT=587
|
|
MAIL_USERNAME=
|
|
MAIL_PASSWORD=
|
|
MAIL_FROM=KLZ Cables <noreply@klz-cables.com>
|
|
MAIL_RECIPIENTS=info@klz-cables.com
|
|
|
|
# ────────────────────────────────────────────────────────────────────────────
|
|
# Logging
|
|
# ────────────────────────────────────────────────────────────────────────────
|
|
LOG_LEVEL=info
|
|
GATEKEEPER_PASSWORD=klz2026
|
|
SENTRY_DSN=
|
|
# For Directus Error Tracking
|
|
# SENTRY_ENVIRONMENT is set automatically by CI
|
|
|
|
# ────────────────────────────────────────────────────────────────────────────
|
|
# Deployment Configuration (CI/CD only)
|
|
# ────────────────────────────────────────────────────────────────────────────
|
|
# These are typically set by the CI/CD workflow
|
|
IMAGE_TAG=latest
|
|
TRAEFIK_HOST=klz-cables.com
|
|
ENV_FILE=.env
|
|
# IMGPROXY_URL: The backend URL of the imgproxy instance (e.g. img.infra.mintel.me)
|
|
# Next.js will proxy requests from /_img to this URL.
|
|
IMGPROXY_URL=https://img.infra.mintel.me
|
|
|
|
# ────────────────────────────────────────────────────────────────────────────
|
|
# Varnish Configuration
|
|
# ────────────────────────────────────────────────────────────────────────────
|
|
VARNISH_CACHE_SIZE=256M
|
|
|
|
# ============================================================================
|
|
# IMPORTANT NOTES
|
|
# ============================================================================
|
|
#
|
|
# BUILD-TIME vs RUNTIME Variables:
|
|
# ─────────────────────────────────
|
|
# • NEXT_PUBLIC_* variables are baked into the client bundle at BUILD time
|
|
# They must be provided as --build-arg when building the Docker image
|
|
#
|
|
# • All other variables are used at RUNTIME only
|
|
# They are loaded from the .env file by docker-compose
|
|
#
|
|
# Docker Deployment:
|
|
# ──────────────────
|
|
# 1. Build-time: Only NEXT_PUBLIC_* vars are needed (via --build-arg)
|
|
# 2. Runtime: All vars are loaded from .env file on the server
|
|
# 3. Branch Deployments:
|
|
# - main branch uses .env.prod
|
|
# - staging branch uses .env.staging
|
|
# - CI/CD supports STAGING_ prefix for all secrets to override defaults
|
|
# - TRAEFIK_HOST is automatically derived from NEXT_PUBLIC_BASE_URL
|
|
#
|
|
# Security:
|
|
# ─────────
|
|
# • NEVER commit .env files with real credentials to git
|
|
# • Use Gitea/GitHub secrets for CI/CD workflows
|
|
# • Store production .env file securely on the server only
|
|
#
|
|
# ============================================================================
|