restructure docs and config, license, readme redo
This commit is contained in:
@@ -0,0 +1,22 @@
|
||||
# Required Environment Variables for TT Booking
|
||||
|
||||
# Generate with: openssl rand -base64 32
|
||||
NEXTAUTH_SECRET=your-secret-key-here
|
||||
|
||||
# Your application URL
|
||||
NEXTAUTH_URL=http://localhost:3000
|
||||
|
||||
# Admin user credentials (change these!)
|
||||
ADMIN_EMAIL=admin@your-domain.com
|
||||
ADMIN_PASSWORD=your-secure-password
|
||||
|
||||
# Optional: Email configuration for notifications
|
||||
EMAIL_USER=your-email@gmail.com
|
||||
EMAIL_PASSWORD=your-gmail-app-password
|
||||
|
||||
# Optional: Rate limiting (defaults shown)
|
||||
RATE_LIMIT_MAX=100
|
||||
RATE_LIMIT_WINDOW=900000
|
||||
|
||||
# Optional: Logging
|
||||
LOG_LEVEL=info
|
||||
@@ -0,0 +1,40 @@
|
||||
# Cloudflare Tunnel Configuration for LCC Table Tennis Booking
|
||||
# Domain: lcc-tt-booking.mikicvi.com
|
||||
|
||||
# Save this as ~/.cloudflared/config.yml after setting up your tunnel
|
||||
|
||||
tunnel: <your-tunnel-id>
|
||||
credentials-file: /home/pi/.cloudflared/<your-tunnel-id>.json
|
||||
|
||||
# Ingress rules
|
||||
ingress:
|
||||
# Main application
|
||||
- hostname: lcc-tt-booking.mikicvi.com
|
||||
service: http://localhost:3000
|
||||
originRequest:
|
||||
# Enable HTTP/2
|
||||
httpHostHeader: lcc-tt-booking.mikicvi.com
|
||||
# Connection settings
|
||||
connectTimeout: 30s
|
||||
tlsTimeout: 10s
|
||||
# Health checks
|
||||
proxyType: http
|
||||
# Disable chunked encoding for better compatibility
|
||||
disableChunkedEncoding: true
|
||||
|
||||
# Health check endpoint (optional, for monitoring)
|
||||
- hostname: health.lcc-tt-booking.mikicvi.com
|
||||
service: http://localhost:3000/api/health
|
||||
|
||||
# Catch-all rule (must be last)
|
||||
- service: http_status:404
|
||||
|
||||
# Optional: Logging configuration
|
||||
loglevel: info
|
||||
transport-loglevel: warn
|
||||
|
||||
# Optional: Metrics
|
||||
metrics: 0.0.0.0:2000
|
||||
|
||||
# Optional: Enable compression
|
||||
compression: gzip
|
||||
@@ -0,0 +1,54 @@
|
||||
# Sample Docker Compose for TT Booking
|
||||
# Copy this file and create a .env file with your settings
|
||||
|
||||
services:
|
||||
tt-booking:
|
||||
image: your-registry/tt-booking:latest
|
||||
container_name: tt-booking
|
||||
ports:
|
||||
- "3000:3000"
|
||||
environment:
|
||||
- NEXTAUTH_URL=http://localhost:3000
|
||||
- NEXTAUTH_SECRET=${NEXTAUTH_SECRET}
|
||||
- ADMIN_EMAIL=${ADMIN_EMAIL:-admin@tabletennis.com}
|
||||
- ADMIN_PASSWORD=${ADMIN_PASSWORD:-admin123}
|
||||
# Optional email settings
|
||||
- EMAIL_USER=${EMAIL_USER}
|
||||
- EMAIL_PASSWORD=${EMAIL_PASSWORD}
|
||||
# Optional rate limiting
|
||||
- RATE_LIMIT_MAX=${RATE_LIMIT_MAX:-100}
|
||||
- RATE_LIMIT_WINDOW=${RATE_LIMIT_WINDOW:-900000}
|
||||
volumes:
|
||||
- ./data:/app/data
|
||||
- ./backups:/app/backups
|
||||
restart: unless-stopped
|
||||
healthcheck:
|
||||
test: ["CMD", "curl", "-f", "http://localhost:3000/api/health"]
|
||||
interval: 30s
|
||||
timeout: 10s
|
||||
retries: 3
|
||||
|
||||
# Optional: Automated backup service
|
||||
backup:
|
||||
image: alpine:latest
|
||||
container_name: tt-booking-backup
|
||||
volumes:
|
||||
- ./data:/data:ro
|
||||
- ./backups:/backups
|
||||
environment:
|
||||
- TZ=UTC
|
||||
command: >
|
||||
sh -c "
|
||||
apk add --no-cache tzdata &&
|
||||
while true; do
|
||||
timestamp=$$(date +%Y%m%d-%H%M%S)
|
||||
echo \"Creating backup at $$timestamp\"
|
||||
cp /data/sqlite.db \"/backups/sqlite-$$timestamp.db\" 2>/dev/null || echo 'No database file found yet'
|
||||
# Keep backups for 7 days
|
||||
find /backups -name 'sqlite-*.db' -mtime +7 -delete 2>/dev/null || true
|
||||
echo \"Backup completed, sleeping for 24 hours\"
|
||||
sleep 86400
|
||||
done"
|
||||
restart: unless-stopped
|
||||
depends_on:
|
||||
- tt-booking
|
||||
Reference in New Issue
Block a user