feat: add production configuration with environment variables
- Add .env file for production deployment with reverse proxy - Add docker-compose.prod.yml for production profile - Add docker-compose.override.yml for local development - Update docker-compose.yml with all configurable variables - Update frontend to use VITE_* environment variables - Update backend to support CORS_ORIGINS and WEBHOOK_BASE_URL - Add vite.config.ts allowedHosts for reverse proxy - Add documentation for docker-compose and reverse proxy setup All URLs are now configurable via environment variables: - VITE_API_URL: Backend API endpoint - VITE_WEBHOOK_BASE_URL: Webhook base URL - VITE_INSTALL_SCRIPT_URL: Install script URL - VITE_APP_URL: Frontend URL - CORS_ORIGINS: Allowed CORS origins - WEBHOOK_BASE_URL: Backend webhook base URL
This commit is contained in:
31
docker-compose.prod.yml
Normal file
31
docker-compose.prod.yml
Normal file
@@ -0,0 +1,31 @@
|
||||
# Docker Compose - Production Configuration
|
||||
# Usage with reverse proxy:
|
||||
# docker compose -f docker-compose.yml -f docker-compose.prod.yml up -d
|
||||
#
|
||||
# Required: Create a .env file with production values before running
|
||||
|
||||
services:
|
||||
frontend:
|
||||
# In production, don't mount source volumes (use built image)
|
||||
volumes:
|
||||
- node_modules:/app/node_modules
|
||||
|
||||
environment:
|
||||
# Production API URLs - these must be set in .env file
|
||||
- VITE_API_URL=${VITE_API_URL}
|
||||
- VITE_WEBHOOK_BASE_URL=${VITE_WEBHOOK_BASE_URL}
|
||||
- VITE_INSTALL_SCRIPT_URL=${VITE_INSTALL_SCRIPT_URL}
|
||||
- VITE_APP_URL=${VITE_APP_URL}
|
||||
- NODE_ENV=production
|
||||
|
||||
fake-backend:
|
||||
environment:
|
||||
# Production CORS - restrict to frontend domain
|
||||
- CORS_ORIGINS=${CORS_ORIGINS}
|
||||
|
||||
# Production webhook URL
|
||||
- WEBHOOK_BASE_URL=${WEBHOOK_BASE_URL}
|
||||
|
||||
# Production settings
|
||||
- NODE_ENV=production
|
||||
- DELAY_MS=${DELAY_MS:-1500}
|
||||
Reference in New Issue
Block a user