Restructure project following production-ready standards
- Add comprehensive docker-compose configuration with health checks - Create Makefile with 16 utility commands for easy management - Implement robust backup/restore/update scripts with error handling - Add optimized PostgreSQL configuration for Gitea workload - Enhance .env.example with clear dev/prod sections and documentation - Create comprehensive README with installation, configuration, and maintenance guides - Improve .gitignore to exclude all sensitive and generated files - Add Redis persistence (AOF) and memory limits - Configure service dependencies with health conditions 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
This commit is contained in:
77
db-config/postgresql.conf
Normal file
77
db-config/postgresql.conf
Normal file
@@ -0,0 +1,77 @@
|
||||
# ============================================
|
||||
# Configuration PostgreSQL optimisée pour Gitea
|
||||
# ============================================
|
||||
# Cette configuration est adaptée pour une instance Gitea
|
||||
# avec une charge modérée (petit à moyen serveur)
|
||||
|
||||
# CONNEXIONS
|
||||
# -------------------------------------------
|
||||
max_connections = 100
|
||||
superuser_reserved_connections = 3
|
||||
|
||||
# MÉMOIRE
|
||||
# -------------------------------------------
|
||||
# Ajustez selon la RAM disponible
|
||||
# Recommandation: 25% de la RAM pour shared_buffers
|
||||
shared_buffers = 256MB
|
||||
effective_cache_size = 1GB
|
||||
maintenance_work_mem = 64MB
|
||||
work_mem = 4MB
|
||||
|
||||
# WRITE AHEAD LOG (WAL)
|
||||
# -------------------------------------------
|
||||
wal_buffers = 16MB
|
||||
min_wal_size = 1GB
|
||||
max_wal_size = 4GB
|
||||
checkpoint_completion_target = 0.9
|
||||
|
||||
# QUERY TUNING
|
||||
# -------------------------------------------
|
||||
random_page_cost = 1.1
|
||||
effective_io_concurrency = 200
|
||||
default_statistics_target = 100
|
||||
|
||||
# LOGGING
|
||||
# -------------------------------------------
|
||||
logging_collector = on
|
||||
log_directory = 'log'
|
||||
log_filename = 'postgresql-%Y-%m-%d.log'
|
||||
log_rotation_age = 1d
|
||||
log_rotation_size = 100MB
|
||||
log_line_prefix = '%t [%p]: [%l-1] user=%u,db=%d,app=%a,client=%h '
|
||||
log_timezone = 'UTC'
|
||||
|
||||
# Logs des requêtes lentes (> 1 seconde)
|
||||
log_min_duration_statement = 1000
|
||||
|
||||
# LOCALE ET FORMATAGE
|
||||
# -------------------------------------------
|
||||
datestyle = 'iso, mdy'
|
||||
timezone = 'UTC'
|
||||
lc_messages = 'en_US.utf8'
|
||||
lc_monetary = 'en_US.utf8'
|
||||
lc_numeric = 'en_US.utf8'
|
||||
lc_time = 'en_US.utf8'
|
||||
default_text_search_config = 'pg_catalog.english'
|
||||
|
||||
# AUTOVACUUM
|
||||
# -------------------------------------------
|
||||
# Important pour maintenir les performances
|
||||
autovacuum = on
|
||||
autovacuum_max_workers = 3
|
||||
autovacuum_naptime = 1min
|
||||
autovacuum_vacuum_threshold = 50
|
||||
autovacuum_analyze_threshold = 50
|
||||
autovacuum_vacuum_scale_factor = 0.1
|
||||
autovacuum_analyze_scale_factor = 0.05
|
||||
|
||||
# SÉCURITÉ
|
||||
# -------------------------------------------
|
||||
# Les connexions sont limitées au réseau Docker
|
||||
listen_addresses = '*'
|
||||
ssl = off
|
||||
|
||||
# AUTRES PARAMÈTRES
|
||||
# -------------------------------------------
|
||||
shared_preload_libraries = ''
|
||||
dynamic_shared_memory_type = posix
|
||||
Reference in New Issue
Block a user