etsy-finance-tracker/server/.env.production
dlawler489 b2da6c69ed Add Nginx reverse proxy for production deployment
Architecture Updates:
- Nginx serves static React files for optimal performance
- Nginx proxies API requests to Node.js backend (port 8080)
- Separation of concerns: static files vs API handling
- Professional production setup with proper caching

Features Added:
- nginx.conf with optimized configuration:
  - Static file serving with long-term caching
  - API reverse proxy with rate limiting
  - Security headers and GZIP compression
  - Health check proxying and SPA routing support
- Updated docker-compose.yml for multi-container setup
- build-deploy.sh script for automated deployment
- Updated environment configuration for container networking

Security & Performance:
- Rate limiting on API and auth endpoints
- Security headers (XSS, CSRF, clickjacking protection)
- GZIP compression for static assets
- Proper cache control headers
- Container-to-container communication

Deployment:
- Single command deployment with ./build-deploy.sh
- Nginx on port 80 (exposed as 3000) serving React app
- API server on internal port 8080 (not exposed)
- Persistent data volume mounting for business files
2026-04-21 06:30:44 +10:00

34 lines
No EOL
755 B
Text

# Production Environment Configuration
# Copy this file to .env and customize for your deployment
# Application
NODE_ENV=production
PORT=8080
# Client Configuration (nginx proxy)
CLIENT_URL=http://nginx
# Database (when using MongoDB)
# MONGODB_URI=mongodb://mongodb:27017/etsy-tracker
# DB_NAME=etsy-tracker
# JWT Configuration
JWT_SECRET=your-super-secret-jwt-key-change-this-in-production
JWT_EXPIRES_IN=7d
# CORS Configuration (nginx handles external requests)
ALLOWED_ORIGINS=http://nginx,http://localhost:3000
# File Upload Limits
MAX_FILE_SIZE=10mb
UPLOAD_PATH=/app/uploads
# Logging
LOG_LEVEL=info
# Rate Limiting (nginx also provides rate limiting)
RATE_LIMIT_WINDOW_MS=900000
RATE_LIMIT_MAX_REQUESTS=100
# Security
BCRYPT_SALT_ROUNDS=12