Files
StarPunk/.env.example
Phil Skentelbery c559f89a7f feat: add production container support with health check endpoint
Implements Phase 5 containerization specification:
- Add /health endpoint for container monitoring
- Create multi-stage Containerfile (Podman/Docker compatible)
- Add compose.yaml for orchestration
- Add Caddyfile.example for reverse proxy (auto-HTTPS)
- Add nginx.conf.example as alternative
- Update .env.example with container and RSS feed variables
- Add gunicorn WSGI server to requirements.txt

Container features:
- Multi-stage build for smaller image size
- Non-root user (starpunk:1000)
- Health check with database connectivity test
- Volume mount for data persistence
- Resource limits and logging configuration
- Security headers and HTTPS configuration examples

Health check endpoint:
- Tests database connectivity
- Verifies filesystem access
- Returns JSON with status, version, and environment

Following Phase 5 design in docs/designs/phase-5-rss-and-container.md
2025-11-19 10:02:41 -07:00

106 lines
3.3 KiB
Plaintext

# StarPunk Configuration Template
# Copy this file to .env and fill in your values
# DO NOT commit .env to version control
# =============================================================================
# SITE CONFIGURATION
# =============================================================================
# Public URL where your site is hosted (no trailing slash)
SITE_URL=http://localhost:5000
# Your site name (appears in RSS feed and page titles)
SITE_NAME=My StarPunk Site
# Your name (appears as author in RSS feed)
SITE_AUTHOR=Your Name
# Site description (appears in RSS feed)
SITE_DESCRIPTION=My personal IndieWeb site
# =============================================================================
# AUTHENTICATION
# =============================================================================
# Your IndieWeb identity URL (REQUIRED)
# This is YOUR personal website URL that you authenticate with
# Example: https://yourname.com or https://github.com/yourname
ADMIN_ME=https://your-website.com
# Session secret key (REQUIRED - GENERATE A RANDOM VALUE)
# Generate with: python3 -c "import secrets; print(secrets.token_hex(32))"
SESSION_SECRET=REPLACE_WITH_RANDOM_SECRET
# Session lifetime in days (default: 30)
SESSION_LIFETIME=30
# IndieLogin service URL (usually don't change this)
INDIELOGIN_URL=https://indielogin.com
# =============================================================================
# DATA STORAGE
# =============================================================================
# Base data directory (relative to project root)
DATA_PATH=./data
# Notes directory (where markdown files are stored)
NOTES_PATH=./data/notes
# SQLite database path
DATABASE_PATH=./data/starpunk.db
# =============================================================================
# FLASK CONFIGURATION
# =============================================================================
# Environment: development or production
FLASK_ENV=development
# Debug mode: 1 (on) or 0 (off)
# NEVER use debug mode in production
FLASK_DEBUG=1
# Flask secret key (falls back to SESSION_SECRET if not set)
FLASK_SECRET_KEY=
# =============================================================================
# RSS FEED CONFIGURATION
# =============================================================================
# Maximum number of items in RSS feed (default: 50)
FEED_MAX_ITEMS=50
# Feed cache duration in seconds (default: 300 = 5 minutes)
FEED_CACHE_SECONDS=300
# =============================================================================
# CONTAINER CONFIGURATION
# =============================================================================
# Application version (for health check endpoint)
VERSION=0.6.0
# Environment: development or production
ENVIRONMENT=production
# Number of Gunicorn workers (default: 4)
# Recommendation: (2 x CPU cores) + 1
WORKERS=4
# Worker timeout in seconds (default: 30)
WORKER_TIMEOUT=30
# Max requests per worker before restart (prevents memory leaks)
MAX_REQUESTS=1000
# =============================================================================
# DEVELOPMENT OPTIONS
# =============================================================================
# Log level: DEBUG, INFO, WARNING, ERROR, CRITICAL
LOG_LEVEL=INFO
# Enable SQL query logging (development only)
SQL_ECHO=0