Files
Termix/docker/docker-compose.yml
ZacharyZcR 27da06d72f DOCKER: Add INTERNAL_AUTH_TOKEN support and improve auto-generation
- Add INTERNAL_AUTH_TOKEN to docker-compose.yml environment variables
- Create comprehensive .env.example with deployment guidance
- Document zero-config deployment for single instances
- Clarify multi-instance deployment requirements
- Ensure auto-generated keys persist in Docker volumes (/app/config)

Security improvements:
- Complete Docker support for new internal auth token mechanism
- Maintains automatic key generation while ensuring persistence
- No manual configuration required for standard deployments

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-09-24 02:17:08 +08:00

68 lines
2.0 KiB
YAML

# Termix Docker Compose Configuration
#
# QUICK START: Just run "docker-compose up -d"
# - Security keys are auto-generated on first startup
# - Keys are persisted in Docker volumes (survive container restarts)
# - No manual .env file needed for single-instance deployment
#
# See docker/.env.example for advanced configuration options
services:
termix:
build:
context: ..
dockerfile: docker/Dockerfile
container_name: termix
restart: unless-stopped
ports:
# HTTP port (redirects to HTTPS if SSL enabled)
- "${PORT:-8080}:8080"
# HTTPS port (when SSL is enabled)
- "${SSL_PORT:-8443}:8443"
volumes:
- termix-data:/app/data
- termix-config:/app/config # Auto-generated .env keys are persisted here
# Optional: Mount custom SSL certificates
# - ./ssl:/app/ssl:ro
environment:
# Basic configuration
- PORT=${PORT:-8080}
- NODE_ENV=${NODE_ENV:-production}
# SSL/TLS Configuration
- ENABLE_SSL=${ENABLE_SSL:-false}
- SSL_PORT=${SSL_PORT:-8443}
- SSL_DOMAIN=${SSL_DOMAIN:-localhost}
- SSL_CERT_PATH=${SSL_CERT_PATH:-/app/ssl/termix.crt}
- SSL_KEY_PATH=${SSL_KEY_PATH:-/app/ssl/termix.key}
# Security keys (auto-generated if not provided)
# Leave empty to auto-generate secure random keys on first startup
# Set values only if you need specific keys for multi-instance deployment
- JWT_SECRET=${JWT_SECRET:-}
- DATABASE_KEY=${DATABASE_KEY:-}
- INTERNAL_AUTH_TOKEN=${INTERNAL_AUTH_TOKEN:-}
# Database configuration
- DATABASE_ENCRYPTION=${DATABASE_ENCRYPTION:-true}
# CORS configuration
- ALLOWED_ORIGINS=${ALLOWED_ORIGINS:-*}
# Health check for both HTTP and HTTPS
healthcheck:
test: |
curl -f -k https://localhost:8443/health 2>/dev/null ||
curl -f http://localhost:8080/health 2>/dev/null ||
exit 1
interval: 30s
timeout: 10s
retries: 3
start_period: 40s
volumes:
termix-data:
driver: local
termix-config:
driver: local