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:
BeauTroll
2025-12-16 19:12:43 +01:00
parent 7b6ba15d8f
commit 6cb3d4239e
9 changed files with 1231 additions and 12 deletions

View File

@@ -4,8 +4,10 @@ services:
container_name: gitea
restart: unless-stopped
depends_on:
- db
- redis
db:
condition: service_healthy
redis:
condition: service_started
environment:
- USER_UID=1000
- USER_GID=1000
@@ -34,9 +36,16 @@ services:
- /etc/localtime:/etc/localtime:ro
networks:
- gitea
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:3000/api/healthz"]
interval: 30s
timeout: 10s
retries: 3
start_period: 40s
db:
image: postgres:15-alpine
container_name: gitea-db
restart: unless-stopped
environment:
- POSTGRES_DB=${POSTGRES_DATABASE}
@@ -44,15 +53,30 @@ services:
- POSTGRES_PASSWORD=${POSTGRES_PASSWORD}
volumes:
- ./postgres:/var/lib/postgresql/data
- ./db-config/postgresql.conf:/etc/postgresql/postgresql.conf:ro
networks:
- gitea
healthcheck:
test: ["CMD-SHELL", "pg_isready -U ${POSTGRES_USER} -d ${POSTGRES_DATABASE}"]
interval: 10s
timeout: 5s
retries: 5
start_period: 10s
redis:
image: redis:alpine
container_name: gitea-redis
restart: unless-stopped
networks:
- gitea
command: redis-server --requirepass ${REDIS_PASSWORD}
command: redis-server --requirepass ${REDIS_PASSWORD} --maxmemory 256mb --maxmemory-policy allkeys-lru --appendonly yes
volumes:
- ./redis:/data
healthcheck:
test: ["CMD", "redis-cli", "--raw", "incr", "ping"]
interval: 10s
timeout: 3s
retries: 5
networks:
gitea: