# CLAUDE.md This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository. ## Project Overview Self-hosted Gitea deployment using Docker Compose with a remote PostgreSQL database and automated daily backups to NAS storage. ## Architecture Two-container setup via `docker-compose.yml`: - **gitea** — Main Gitea application (`gitea/gitea:latest`). Web UI on port 3008, SSH on port 2222. Connects to a remote PostgreSQL instance at `192.168.50.42:5432`. - **gitea-backup** — Alpine sidecar that installs `docker-cli`, sets up a cron job (2 AM daily), and runs `backup.sh` via `docker exec` into the gitea container. Backup files (`gitea-dump-YYYY-MM-DD_HHMM.zip`) are written to `/mnt/nasen/backup/gitea` (NAS mount) with 7-day retention. ## Common Commands ```bash # Start/stop services docker-compose up -d docker-compose down # View logs docker-compose logs -f gitea docker-compose logs -f gitea-backup # Run a manual backup docker exec gitea-backup /usr/local/bin/backup.sh # Check backup logs inside sidecar docker exec gitea-backup cat /var/log/backup.log # Access Gitea admin CLI docker exec -u git gitea /app/gitea/gitea admin [subcommand] ``` ## Key Files - `docker-compose.yml` — Service definitions, environment config, volume mounts - `backup.sh` — Backup script: runs `gitea dump`, verifies output, enforces retention policy